Polish
This commit is contained in:
@@ -20,6 +20,7 @@ import groovy.transform.Canonical
|
||||
import groovy.transform.EqualsAndHashCode
|
||||
import groovy.transform.PackageScope
|
||||
import groovy.util.logging.Slf4j
|
||||
import org.springframework.cloud.contract.spec.Contract
|
||||
import org.springframework.cloud.contract.verifier.config.ContractVerifierConfigProperties
|
||||
import org.springframework.cloud.contract.verifier.config.TestFramework
|
||||
import org.springframework.cloud.contract.verifier.file.ContractMetadata
|
||||
@@ -130,7 +131,7 @@ class SingleTestGenerator {
|
||||
@EqualsAndHashCode
|
||||
private static class ParsedDsl {
|
||||
ContractMetadata contract
|
||||
org.springframework.cloud.contract.spec.Contract groovyDsl
|
||||
Contract groovyDsl
|
||||
File stubsFile
|
||||
}
|
||||
|
||||
@@ -139,10 +140,10 @@ class SingleTestGenerator {
|
||||
}
|
||||
|
||||
private boolean isScenarioClass(Collection<ContractMetadata> listOfFiles) {
|
||||
listOfFiles.find({ it.order != null }) != null
|
||||
return listOfFiles.find({ it.order != null }) != null
|
||||
}
|
||||
|
||||
private ClassBuilder addJsonPathRelatedImports(ClassBuilder clazz) {
|
||||
private void addJsonPathRelatedImports(ClassBuilder clazz) {
|
||||
clazz.addImport(['com.jayway.jsonpath.DocumentContext',
|
||||
'com.jayway.jsonpath.JsonPath',
|
||||
])
|
||||
@@ -151,7 +152,7 @@ class SingleTestGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
private ClassBuilder addMessagingRelatedEntries(ClassBuilder clazz) {
|
||||
private void addMessagingRelatedEntries(ClassBuilder clazz) {
|
||||
clazz.addField(['@Inject ContractVerifierMessaging contractVerifierMessaging',
|
||||
'ContractVerifierObjectMapper contractVerifierObjectMapper = new ContractVerifierObjectMapper()'
|
||||
])
|
||||
|
||||
@@ -62,7 +62,7 @@ class WireMockRequestStubStrategy extends BaseWireMockStubStrategy {
|
||||
|
||||
private RequestPatternBuilder appendMethodAndUrl() {
|
||||
if(!request.method) {
|
||||
return
|
||||
return null
|
||||
}
|
||||
RequestMethod requestMethod = RequestMethod.fromString(request.method.clientValue?.toString())
|
||||
UrlPattern urlPattern = urlPattern()
|
||||
|
||||
@@ -23,7 +23,7 @@ package org.springframework.cloud.contract.verifier.util;
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public interface MethodBuffering {
|
||||
interface MethodBuffering {
|
||||
|
||||
String method();
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ import org.apache.camel.impl.DefaultMessage;
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
public class ContractVerifierCamelMessageBuilder {
|
||||
class ContractVerifierCamelMessageBuilder {
|
||||
|
||||
public <T> Message create(T payload, Map<String, Object> headers) {
|
||||
DefaultMessage message = new DefaultMessage();
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.springframework.messaging.support.MessageBuilder;
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
public class ContractVerifierIntegrationMessageBuilder {
|
||||
class ContractVerifierIntegrationMessageBuilder {
|
||||
|
||||
public <T> Message<T> create(T payload, Map<String, Object> headers) {
|
||||
return MessageBuilder.createMessage(payload, new MessageHeaders(headers));
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.cloud.contract.verifier.messaging.MessageVerifier;
|
||||
*/
|
||||
public class ContractVerifierMessaging<M> {
|
||||
|
||||
private MessageVerifier<M> exchange;
|
||||
private final MessageVerifier<M> exchange;
|
||||
|
||||
public ContractVerifierMessaging(MessageVerifier<M> exchange) {
|
||||
this.exchange = exchange;
|
||||
|
||||
@@ -25,7 +25,7 @@ import org.springframework.messaging.support.MessageBuilder;
|
||||
/**
|
||||
* @author Marcin Grzejszczak
|
||||
*/
|
||||
public class ContractVerifierStreamMessageBuilder {
|
||||
class ContractVerifierStreamMessageBuilder {
|
||||
|
||||
public <T> Message<?> create(T payload, Map<String, Object> headers) {
|
||||
return MessageBuilder.createMessage(payload, new MessageHeaders(headers));
|
||||
|
||||
@@ -83,7 +83,6 @@ public class StreamStubMessages implements MessageVerifier<Message<?>> {
|
||||
private String resolvedDestination(String destination) {
|
||||
ChannelBindingServiceProperties channelBindingServiceProperties = context
|
||||
.getBean(ChannelBindingServiceProperties.class);
|
||||
String resolvedDestination = destination;
|
||||
for (Map.Entry<String, BindingProperties> entry : channelBindingServiceProperties
|
||||
.getBindings().entrySet()) {
|
||||
if (entry.getValue().getDestination().equals(destination)) {
|
||||
@@ -95,7 +94,7 @@ public class StreamStubMessages implements MessageVerifier<Message<?>> {
|
||||
log.debug(
|
||||
"No destination named [{}] was found. Assuming that the destination equals the channel name",
|
||||
destination);
|
||||
return resolvedDestination;
|
||||
return destination;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user