Update readme of jaxb version
Change-Id: I09479e17c8e7c1bbc5be881c8526de63c681f4e4
This commit is contained in:
parent
b75a6d84db
commit
18e75f3352
1 changed files with 34 additions and 30 deletions
64
README.md
64
README.md
|
@ -18,7 +18,7 @@ java -jar mockserver-<VERSION>-jar-with-dependencies.jar [PORT]
|
||||||
|
|
||||||
```java
|
```java
|
||||||
RemoteMockServer remoteMockServer = new RemoteMockServer('localhost', <PORT>)
|
RemoteMockServer remoteMockServer = new RemoteMockServer('localhost', <PORT>)
|
||||||
remoteMockServer.addMock(new AddMockRequestData(
|
remoteMockServer.addMock(new AddMock(
|
||||||
name: '...',
|
name: '...',
|
||||||
path: '...',
|
path: '...',
|
||||||
port: ...,
|
port: ...,
|
||||||
|
@ -35,7 +35,7 @@ or via sending POST request to localhost:<PORT>/serverControl
|
||||||
|
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<addMock>
|
<addMock xmlns="http://touk.pl/mockserver/api/request">
|
||||||
<name>...</name>
|
<name>...</name>
|
||||||
<path>...</path>
|
<path>...</path>
|
||||||
<port>...</port>
|
<port>...</port>
|
||||||
|
@ -72,13 +72,13 @@ In closures input parameter (called req) contains properties:
|
||||||
Response if success:
|
Response if success:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<mockAdded/>
|
<mockAdded xmlns="http://touk.pl/mockserver/api/response"/>
|
||||||
```
|
```
|
||||||
|
|
||||||
Response with error message if failure:
|
Response with error message if failure:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<exceptionOccured>...</exceptionOccured>
|
<exceptionOccured xmlns="http://touk.pl/mockserver/api/response">...</exceptionOccured>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Mock could be peeked to get get report of its invocations.
|
## Mock could be peeked to get get report of its invocations.
|
||||||
|
@ -91,61 +91,60 @@ List<MockEvent> mockEvents = remoteMockServer.peekMock('...')
|
||||||
Via sending POST request to localhost:<PORT>/serverControl
|
Via sending POST request to localhost:<PORT>/serverControl
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<peekMock>
|
<peekMock xmlns="http://touk.pl/mockserver/api/request">
|
||||||
<name>...</name>
|
<name>...</name>
|
||||||
</peekMock>
|
</peekMock>
|
||||||
```
|
```
|
||||||
|
|
||||||
Response if success:
|
Response if success:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<mockPeeked>
|
<mockPeeked xmlns="http://touk.pl/mockserver/api/response">
|
||||||
<mockEvent>
|
<mockEvent>
|
||||||
<request>
|
<request>
|
||||||
<text>...</text>
|
<text>...</text>
|
||||||
<headers>
|
<headers>
|
||||||
<param name='...'>...</param>
|
<header name="...">...</header>
|
||||||
...
|
...
|
||||||
</headers>
|
</headers>
|
||||||
<query>
|
<queryParams>
|
||||||
<param name='...'>...</param>
|
<queryParam name="...">...</queryParam>
|
||||||
...
|
...
|
||||||
</query>
|
</queryParams>
|
||||||
<path>
|
<path>
|
||||||
<elem>...</elem>
|
<pathPart>...</pathPart>
|
||||||
...
|
...
|
||||||
</path>
|
</path>
|
||||||
</request>
|
</request>
|
||||||
<response>
|
<response>
|
||||||
|
<statusCode>...</statusCode>
|
||||||
<text>...</text>
|
<text>...</text>
|
||||||
<headers>
|
<headers>
|
||||||
<param name='...'>...</param>
|
<header name="...">...</header>
|
||||||
...
|
...
|
||||||
</headers>
|
</headers>
|
||||||
<statusCode>...</statusCode>
|
|
||||||
</response>
|
</response>
|
||||||
</mockEvent>
|
</mockEvent>
|
||||||
...
|
|
||||||
</mockPeeked>
|
</mockPeeked>
|
||||||
```
|
```
|
||||||
|
|
||||||
Response with error message if failure:
|
Response with error message if failure:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<exceptionOccured>...</exceptionOccured>
|
<exceptionOccured xmlns="http://touk.pl/mockserver/api/response">...</exceptionOccured>
|
||||||
```
|
```
|
||||||
|
|
||||||
## When mock was used it could be unregistered by name. It also returns report of mock invocations.
|
## When mock was used it could be unregistered by name. It also optionally returns report of mock invocations if second parameter is true.
|
||||||
Via client:
|
Via client:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
List<MockEvent> mockEvents = remoteMockServer.removeMock('...')
|
List<MockEvent> mockEvents = remoteMockServer.removeMock('...', ...)
|
||||||
```
|
```
|
||||||
|
|
||||||
Via sending POST request to localhost:<PORT>/serverControl
|
Via sending POST request to localhost:<PORT>/serverControl
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<removeMock>
|
<removeMock xmlns="http://touk.pl/mockserver/api/request">
|
||||||
<name>...</name>
|
<name>...</name>
|
||||||
<skipReport>...</skipReport>
|
<skipReport>...</skipReport>
|
||||||
</removeMock>
|
</removeMock>
|
||||||
|
@ -154,47 +153,46 @@ Via sending POST request to localhost:<PORT>/serverControl
|
||||||
Response if success (and skipReport not given or equal false):
|
Response if success (and skipReport not given or equal false):
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<mockRemoved>
|
<mockRemoved xmlns="http://touk.pl/mockserver/api/response">
|
||||||
<mockEvent>
|
<mockEvent>
|
||||||
<request>
|
<request>
|
||||||
<text>...</text>
|
<text>...</text>
|
||||||
<headers>
|
<headers>
|
||||||
<param name='...'>...</param>
|
<header name="...">...</header>
|
||||||
...
|
...
|
||||||
</headers>
|
</headers>
|
||||||
<query>
|
<queryParams>
|
||||||
<param name='...'>...</param>
|
<queryParam name="...">...</queryParam>
|
||||||
...
|
...
|
||||||
</query>
|
</queryParams>
|
||||||
<path>
|
<path>
|
||||||
<elem>...</elem>
|
<pathPart>...</pathPart>
|
||||||
...
|
...
|
||||||
</path>
|
</path>
|
||||||
</request>
|
</request>
|
||||||
<response>
|
<response>
|
||||||
|
<statusCode>...</statusCode>
|
||||||
<text>...</text>
|
<text>...</text>
|
||||||
<headers>
|
<headers>
|
||||||
<param name='...'>...</param>
|
<header name="...">...</header>
|
||||||
...
|
...
|
||||||
</headers>
|
</headers>
|
||||||
<statusCode>...</statusCode>
|
|
||||||
</response>
|
</response>
|
||||||
</mockEvent>
|
</mockEvent>
|
||||||
...
|
|
||||||
</mockRemoved>
|
</mockRemoved>
|
||||||
```
|
```
|
||||||
|
|
||||||
If skipReport is set to true then response will be:
|
If skipReport is set to true then response will be:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<mockRemoved/>
|
<mockRemoved xmlns="http://touk.pl/mockserver/api/response"/>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
Response with error message if failure:
|
Response with error message if failure:
|
||||||
|
|
||||||
```xml
|
```xml
|
||||||
<exceptionOccured>...</exceptionOccured>
|
<exceptionOccured xmlns="http://touk.pl/mockserver/api/response">...</exceptionOccured>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -215,6 +213,12 @@ Response:
|
||||||
<name>...</name>
|
<name>...</name>
|
||||||
<path>...</path>
|
<path>...</path>
|
||||||
<port>...</port>
|
<port>...</port>
|
||||||
|
<predicate>...</predicate>
|
||||||
|
<response>...</response>
|
||||||
|
<responseHeaders>...</responseHeaders>
|
||||||
|
<soap>...</soap>
|
||||||
|
<method>...</method>
|
||||||
|
<statusCode>...</statusCode>
|
||||||
</mock>
|
</mock>
|
||||||
...
|
...
|
||||||
</mocks>
|
</mocks>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue