Add support for each http method
This commit is contained in:
parent
b3e3dfb3f3
commit
1be072f440
6 changed files with 192 additions and 24 deletions
|
@ -10,14 +10,24 @@ class AddMockRequestData {
|
|||
String response
|
||||
Boolean soap
|
||||
Integer statusCode
|
||||
Method method
|
||||
|
||||
void setPredicate(String predicate){
|
||||
void setPredicate(String predicate) {
|
||||
this.predicate = StringEscapeUtils.escapeXml11(predicate)
|
||||
}
|
||||
|
||||
void setResponse(String response){
|
||||
void setResponse(String response) {
|
||||
this.response = StringEscapeUtils.escapeXml11(response)
|
||||
}
|
||||
|
||||
|
||||
enum Method {
|
||||
POST,
|
||||
GET,
|
||||
DELETE,
|
||||
PUT,
|
||||
TRACE,
|
||||
HEAD,
|
||||
OPTIONS,
|
||||
PATCH
|
||||
}
|
||||
}
|
||||
|
|
|
@ -55,10 +55,11 @@ class ControlServerClient {
|
|||
<name>${data.name}</name>
|
||||
<path>${data.path}</path>
|
||||
<port>${data.port}</port>
|
||||
${data.predicate != null ? "<predicate>${data.predicate}</predicate>" : ''}
|
||||
${data.response != null ? "<response>${data.response}</response>" : ''}
|
||||
${data.predicate ? "<predicate>${data.predicate}</predicate>" : ''}
|
||||
${data.response ? "<response>${data.response}</response>" : ''}
|
||||
${data.soap != null ? "<soap>${data.soap}</soap>" : ''}
|
||||
${data.statusCode != null ? "<statusCode>${data.statusCode}</statusCode>" : ''}
|
||||
${data.statusCode ? "<statusCode>${data.statusCode}</statusCode>" : ''}
|
||||
${data.method ? "<method>${data.method}</method>" : ''}
|
||||
</addMock>
|
||||
""", ContentType.create("text/xml", "UTF-8"))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue