Code cleanup.
This commit is contained in:
@@ -82,11 +82,11 @@ class MatchingRulesConverter {
|
||||
break
|
||||
case MatchingType.REGEX:
|
||||
String pattern = it.value().toString()
|
||||
if (pattern.equals(regexPatterns.number().pattern())) {
|
||||
if (pattern == regexPatterns.number().pattern()) {
|
||||
category.addRule(key, new NumberTypeMatcher(NumberTypeMatcher.NumberType.NUMBER))
|
||||
} else if (pattern.equals(regexPatterns.anInteger().pattern())) {
|
||||
} else if (pattern == regexPatterns.anInteger().pattern()) {
|
||||
category.addRule(key, new NumberTypeMatcher(NumberTypeMatcher.NumberType.INTEGER))
|
||||
} else if (pattern.equals(regexPatterns.aDouble().pattern())) {
|
||||
} else if (pattern == regexPatterns.aDouble().pattern()) {
|
||||
category.addRule(key, new NumberTypeMatcher(NumberTypeMatcher.NumberType.DECIMAL))
|
||||
} else {
|
||||
category.addRule(key, new RegexMatcher(pattern))
|
||||
|
||||
@@ -69,7 +69,7 @@ class MessagingSCContractCreator {
|
||||
throw new UnsupportedOperationException("Currently only the AND combination rule logic is supported")
|
||||
}
|
||||
|
||||
if (FULL_BODY.equals(key)) {
|
||||
if (FULL_BODY == key) {
|
||||
JsonPaths jsonPaths = JsonToJsonPathsConverter.transformToJsonPathWithStubsSideValuesAndNoArraySizeCheck(message.contents.value)
|
||||
jsonPaths.each {
|
||||
jsonPath(it.keyBeforeChecking(), byType())
|
||||
|
||||
@@ -49,7 +49,7 @@ class RequestResponsePactCreator {
|
||||
Names names = NamingUtil.name(contracts.get(0))
|
||||
PactDslWithProvider pactDslWithProvider = ConsumerPactBuilder
|
||||
.consumer(names.consumer).hasPactWith(names.producer)
|
||||
PactDslResponse pactDslResponse = null;
|
||||
PactDslResponse pactDslResponse = null
|
||||
contracts.each { Contract contract ->
|
||||
assertNoExecutionProperty(contract)
|
||||
PactDslRequestWithPath pactDslRequest = pactDslResponse ?
|
||||
|
||||
@@ -168,7 +168,7 @@ class RequestResponseSCContractCreator {
|
||||
throw new UnsupportedOperationException("Currently only the AND combination rule logic is supported")
|
||||
}
|
||||
|
||||
if (FULL_BODY.equals(key)) {
|
||||
if (FULL_BODY == key) {
|
||||
JsonPaths jsonPaths = JsonToJsonPathsConverter.transformToJsonPathWithStubsSideValuesAndNoArraySizeCheck(response.body.value)
|
||||
jsonPaths.each {
|
||||
jsonPath(it.keyBeforeChecking(), byType())
|
||||
|
||||
Reference in New Issue
Block a user