Fixed flakey test
This commit is contained in:
@@ -107,8 +107,10 @@ class ContractSpec extends Specification {
|
||||
request.with {
|
||||
property = value(consumer(regex("[0-9]{5}")))
|
||||
}
|
||||
def value = Integer.valueOf(property.serverValue as String)
|
||||
then:
|
||||
(property.serverValue as String).matches(/[0-9]{5}/)
|
||||
value >= 0
|
||||
value <= 99_999
|
||||
}
|
||||
|
||||
def 'should set a description'() {
|
||||
|
||||
@@ -14,7 +14,9 @@ class InputSpec extends Specification {
|
||||
input.with {
|
||||
property = $(consumer(regex("[0-9]{5}")))
|
||||
}
|
||||
def value = Integer.valueOf(property.serverValue as String)
|
||||
then:
|
||||
(property.serverValue as String).matches(/[0-9]{5}/)
|
||||
value >= 0
|
||||
value <= 99_999
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,9 @@ class OutputMessageSpec extends Specification {
|
||||
input.with {
|
||||
property = $(consumer(regex("[0-9]{5}")))
|
||||
}
|
||||
def value = Integer.valueOf(property.serverValue as String)
|
||||
then:
|
||||
(property.serverValue as String).matches(/[0-9]{5}/)
|
||||
value >= 0
|
||||
value <= 99_999
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,9 @@ class RequestSpec extends Specification {
|
||||
request.with {
|
||||
property = value(consumer(regex("[0-9]{5}")))
|
||||
}
|
||||
def value = Integer.valueOf(property.serverValue as String)
|
||||
then:
|
||||
(property.serverValue as String).matches(/[0-9]{5}/)
|
||||
value >= 0
|
||||
value <= 99_999
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,8 +34,10 @@ class ResponseSpec extends Specification {
|
||||
request.with {
|
||||
property = value(producer(regex("[0-9]{5}")))
|
||||
}
|
||||
def value = Integer.valueOf(property.clientValue as String)
|
||||
then:
|
||||
(property.clientValue as String).matches(/[0-9]{5}/)
|
||||
value >= 0
|
||||
value <= 99_999
|
||||
(property.serverValue as Pattern).pattern() == '[0-9]{5}'
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user