Add more tests

This commit is contained in:
Denis Stepanov
2015-06-05 12:56:58 +02:00
parent 194d4a034a
commit 1eb035189e

View File

@@ -343,7 +343,7 @@ class WiremockGroovyDslSpec extends WiremockSpec {
{
"request": {
"method": "GET",
"urlPath":"users",
"urlPath": "users",
"queryParameters": {
"offset": {
"contains": "10"
@@ -377,6 +377,64 @@ class WiremockGroovyDslSpec extends WiremockSpec {
stubMappingIsValidWiremockStub(json)
}
def "should generate request with urlPath for client side"() {
given:
GroovyDsl groovyDsl = GroovyDsl.make {
request {
method 'GET'
urlPath $(client("boxes"), server("items"))
}
response {
status 200
}
}
when:
def json = toWiremockClientJsonStub(groovyDsl)
then:
parseJson(json) == parseJson('''
{
"request": {
"method": "GET",
"urlPath": "boxes"
},
"response": {
"status": 200,
}
}
''')
and:
stubMappingIsValidWiremockStub(json)
}
def "should generate simple request with urlPath for client side"() {
given:
GroovyDsl groovyDsl = GroovyDsl.make {
request {
method 'GET'
urlPath "boxes"
}
response {
status 200
}
}
when:
def json = toWiremockClientJsonStub(groovyDsl)
then:
parseJson(json) == parseJson('''
{
"request": {
"method": "GET",
"urlPath": "boxes"
},
"response": {
"status": 200,
}
}
''')
and:
stubMappingIsValidWiremockStub(json)
}
def "should generate request with url and queryParameters for client side"() {
given:
GroovyDsl groovyDsl = GroovyDsl.make {