diff --git a/multi/multi__spring_cloud_contract_stub_runner.html b/multi/multi__spring_cloud_contract_stub_runner.html index 4b7720c6f5..f60b2bd4e2 100644 --- a/multi/multi__spring_cloud_contract_stub_runner.html +++ b/multi/multi__spring_cloud_contract_stub_runner.html @@ -294,19 +294,20 @@ Check their import org.springframework.cloud.contract.spec.Contract; public interface StubFinder extends StubTrigger { + /** - * For the given groupId and artifactId tries to find the matching - * URL of the running stub. - * - * @param groupId - might be null. In that case a search only via artifactId takes place + * For the given groupId and artifactId tries to find the matching URL of the running + * stub. + * @param groupId - might be null. In that case a search only via artifactId takes + * place * @return URL of a running stub or throws exception if not found */ URL findStubUrl(String groupId, String artifactId) throws StubNotFoundException; /** - * For the given Ivy notation {@code [groupId]:artifactId:[version]:[classifier]} tries to - * find the matching URL of the running stub. You can also pass only {@code artifactId}. - * + * For the given Ivy notation {@code [groupId]:artifactId:[version]:[classifier]} + * tries to find the matching URL of the running stub. You can also pass only + * {@code artifactId}. * @param ivyNotation - Ivy representation of the Maven artifact * @return URL of a running stub or throws exception if not found */ @@ -321,6 +322,7 @@ Check their Map<StubConfiguration, Collection<Contract>> getContracts(); + }

Example of usage in Spock tests:

@ClassRule @Shared StubRunnerRule rule = new StubRunnerRule()
 		.stubsMode(StubRunnerProperties.StubsMode.REMOTE)
 		.repoRoot(StubRunnerRuleSpec.getResource("/m2repo/repository").toURI().toString())
diff --git a/multi/multi__spring_cloud_contract_wiremock.html b/multi/multi__spring_cloud_contract_wiremock.html
index ab7fe3047c..5ba211e421 100644
--- a/multi/multi__spring_cloud_contract_wiremock.html
+++ b/multi/multi__spring_cloud_contract_wiremock.html
@@ -12,21 +12,23 @@ your test. The following code shows an example:

<
 @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
 @AutoConfigureWireMock(port = 0)
 public class WiremockForDocsTests {
+
 	// A service that calls out over HTTP
-	@Autowired private Service service;
+	@Autowired
+	private Service service;
 
 	// Using the WireMock APIs in the normal way:
 	@Test
 	public void contextLoads() throws Exception {
 		// Stubbing WireMock
-		stubFor(get(urlEqualTo("/resource"))
-				.willReturn(aResponse().withHeader("Content-Type", "text/plain").withBody("Hello World!")));
+		stubFor(get(urlEqualTo("/resource")).willReturn(aResponse()
+				.withHeader("Content-Type", "text/plain").withBody("Hello World!")));
 		// We're asserting if WireMock responded properly
 		assertThat(this.service.go()).isEqualTo("Hello World!");
 	}
 
 }
-//end::wiremock_test2[]

To start the stub server on a different port use (for example), +// end::wiremock_test2[]

To start the stub server on a different port use (for example), @AutoConfigureWireMock(port=9999). For a random port, use a value of 0. The stub server port can be bound in the test application context with the "wiremock.server.port" property. Using @AutoConfigureWireMock adds a bean of type WiremockConfiguration to @@ -72,6 +74,7 @@ instance, as shown in the following example:


 	@ClassRule
 	public static WireMockClassRule wiremock = new WireMockClassRule(
 			WireMockSpring.options().dynamicPort());
+
 	// A service that calls out over HTTP to localhost:${wiremock.port}
 	@Autowired
 	private Service service;
@@ -80,14 +83,14 @@ instance, as shown in the following example:


 	@Test
 	public void contextLoads() throws Exception {
 		// Stubbing WireMock
-		wiremock.stubFor(get(urlEqualTo("/resource"))
-				.willReturn(aResponse().withHeader("Content-Type", "text/plain").withBody("Hello World!")));
+		wiremock.stubFor(get(urlEqualTo("/resource")).willReturn(aResponse()
+				.withHeader("Content-Type", "text/plain").withBody("Hello World!")));
 		// We're asserting if WireMock responded properly
 		assertThat(this.service.go()).isEqualTo("Hello World!");
 	}
 
 }
-//end::wiremock_test2[]

The @ClassRule means that the server shuts down after all the methods in this class +// end::wiremock_test2[]

The @ClassRule means that the server shuts down after all the methods in this class have been run.

11.4 Relaxed SSL Validation for Rest Template

WireMock lets you stub a "secure" server with an "https" URL protocol. If your application wants to contact that stub server in an integration test, it will find that the SSL certificates are not valid (the usual problem with self-installed certificates). @@ -136,6 +139,7 @@ a Spring MockRestServiceServer. The following code assertThat(this.service.go()).isEqualTo("Hello World"); server.verify(); } + }

The baseUrl value is prepended to all mock calls, and the stubs() method takes a stub path resource pattern as an argument. In the preceding example, the stub defined at /stubs/resource.json is loaded into the mock server. If the RestTemplate is asked to @@ -148,9 +152,11 @@ Spring Boot embedded servers, and Wiremock itself has "native" support for a par version of Jetty (currently 9.2). To use the native Jetty, you need to add the native Wiremock dependencies and exclude the Spring Boot container (if there is one).

11.6 Customization of WireMock configuration

You can register a bean of org.springframework.cloud.contract.wiremock.WireMockConfigurationCustomizer type in order to customize the WireMock configuration (e.g. add custom transformers). -Example:

		@Bean WireMockConfigurationCustomizer optionsCustomizer() {
+Example:

		@Bean
+		WireMockConfigurationCustomizer optionsCustomizer() {
 			return new WireMockConfigurationCustomizer() {
-				@Override public void customize(WireMockConfiguration options) {
+				@Override
+				public void customize(WireMockConfiguration options) {
 // perform your customization here
 				}
 			};
@@ -264,16 +270,14 @@ about a situation in which they would like to move to DSL-based contract definit
 but they already have a lot of Spring MVC tests. Using this feature lets you generate
 the contract files that you can later modify and move to folders (defined in your
 configuration) so that the plugin finds them.

[Tip]Tip

You might wonder why this functionality is in the WireMock module. The functionality -is there because it makes sense to generate both the contracts and the stubs.

Consider the following test:

		this.mockMvc.perform(post("/foo")
-					.accept(MediaType.APPLICATION_PDF)
-					.accept(MediaType.APPLICATION_JSON)
-					.contentType(MediaType.APPLICATION_JSON)
-					.content("{\"foo\": 23, \"bar\" : \"baz\" }"))
-				.andExpect(status().isOk())
-				.andExpect(content().string("bar"))
+is there because it makes sense to generate both the contracts and the stubs.

Consider the following test:

		this.mockMvc
+				.perform(post("/foo").accept(MediaType.APPLICATION_PDF)
+						.accept(MediaType.APPLICATION_JSON)
+						.contentType(MediaType.APPLICATION_JSON)
+						.content("{\"foo\": 23, \"bar\" : \"baz\" }"))
+				.andExpect(status().isOk()).andExpect(content().string("bar"))
 				// first WireMock
-				.andDo(WireMockRestDocs.verify()
-						.jsonPath("$[?(@.foo >= 20)]")
+				.andDo(WireMockRestDocs.verify().jsonPath("$[?(@.foo >= 20)]")
 						.jsonPath("$[?(@.bar in ['baz','bazz','bazzz'])]")
 						.contentType(MediaType.valueOf("application/json"))
 						.stub("shouldGrantABeerIfOldEnough"))
diff --git a/multi/multi_stub-runner-for-messaging.html b/multi/multi_stub-runner-for-messaging.html
index edf0586ed6..2dd19c55af 100644
--- a/multi/multi_stub-runner-for-messaging.html
+++ b/multi/multi_stub-runner-for-messaging.html
@@ -12,10 +12,10 @@ That way the only remaining framework is Spring AMQP.

public interface StubTrigger { /** - * Triggers an event by a given label for a given {@code groupid:artifactid} notation. You can use only {@code artifactId} too. + * Triggers an event by a given label for a given {@code groupid:artifactid} notation. + * You can use only {@code artifactId} too. * * Feature related to messaging. - * * @return true - if managed to run a trigger */ boolean trigger(String ivyNotation, String labelName); @@ -24,7 +24,6 @@ That way the only remaining framework is Spring AMQP.

boolean trigger(String labelName); @@ -33,7 +32,6 @@ That way the only remaining framework is Spring AMQP.

boolean trigger(); @@ -44,6 +42,7 @@ That way the only remaining framework is Spring AMQP.

Map<String, Collection<String>> labels(); + }

For convenience, the StubFinder interface extends StubTrigger, so you only need one or the other in your tests.

StubTrigger gives you the following options to trigger a message:

7.1.1 Trigger by Label

stubFinder.trigger('return_book_1')

7.1.2 Trigger by Group and Artifact Ids

stubFinder.trigger('org.springframework.cloud.contract.verifier.stubs:streamService', 'return_book_1')

7.1.3 Trigger by Artifact Ids

stubFinder.trigger('streamService', 'return_book_1')

7.1.4 Trigger All Messages

stubFinder.trigger()

7.2 Stub Runner Integration

Spring Cloud Contract Verifier Stub Runner’s messaging module gives you an easy way to integrate with Spring Integration. For the provided artifacts, it automatically downloads @@ -270,20 +269,20 @@ to disable them explicitly by setting the stubrunner.stre follows:

stubTrigger.trigger("contract-test.person.created.event")

The message has a destination of contract-test.exchange, so the Spring AMQP stub runner integration looks for bindings related to this exchange.

@Bean
 public Binding binding() {
-	return BindingBuilder.bind(new Queue("test.queue")).to(new DirectExchange("contract-test.exchange")).with("#");
+	return BindingBuilder.bind(new Queue("test.queue"))
+			.to(new DirectExchange("contract-test.exchange")).with("#");
 }

The binding definition binds the queue test.queue. As a result, the following listener definition is matched and invoked with the contract message.

@Bean
-public SimpleMessageListenerContainer simpleMessageListenerContainer(ConnectionFactory connectionFactory,
-																		MessageListenerAdapter listenerAdapter) {
+public SimpleMessageListenerContainer simpleMessageListenerContainer(
+		ConnectionFactory connectionFactory,
+		MessageListenerAdapter listenerAdapter) {
 	SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
 	container.setConnectionFactory(connectionFactory);
 	container.setQueueNames("test.queue");
 	container.setMessageListener(listenerAdapter);
 
 	return container;
-}

Also, the following annotated listener matches and is invoked:

@RabbitListener(bindings = @QueueBinding(
-		value = @Queue(value = "test.queue"),
-		exchange = @Exchange(value = "contract-test.exchange", ignoreDeclarationExceptions = "true")))
+}

Also, the following annotated listener matches and is invoked:

@RabbitListener(bindings = @QueueBinding(value = @Queue(value = "test.queue"), exchange = @Exchange(value = "contract-test.exchange", ignoreDeclarationExceptions = "true")))
 public void handlePerson(Person person) {
 	this.person = person;
 }
[Note]Note

The message is directly handed over to the onMessage method of the diff --git a/single/spring-cloud-contract.html b/single/spring-cloud-contract.html index b8051cc7b9..b0d7ce6937 100644 --- a/single/spring-cloud-contract.html +++ b/single/spring-cloud-contract.html @@ -2619,19 +2619,20 @@ Check their import org.springframework.cloud.contract.spec.Contract; public interface StubFinder extends StubTrigger { + /** - * For the given groupId and artifactId tries to find the matching - * URL of the running stub. - * - * @param groupId - might be null. In that case a search only via artifactId takes place + * For the given groupId and artifactId tries to find the matching URL of the running + * stub. + * @param groupId - might be null. In that case a search only via artifactId takes + * place * @return URL of a running stub or throws exception if not found */ URL findStubUrl(String groupId, String artifactId) throws StubNotFoundException; /** - * For the given Ivy notation {@code [groupId]:artifactId:[version]:[classifier]} tries to - * find the matching URL of the running stub. You can also pass only {@code artifactId}. - * + * For the given Ivy notation {@code [groupId]:artifactId:[version]:[classifier]} + * tries to find the matching URL of the running stub. You can also pass only + * {@code artifactId}. * @param ivyNotation - Ivy representation of the Maven artifact * @return URL of a running stub or throws exception if not found */ @@ -2646,6 +2647,7 @@ Check their Map<StubConfiguration, Collection<Contract>> getContracts(); + }

Example of usage in Spock tests:

@ClassRule @Shared StubRunnerRule rule = new StubRunnerRule()
 		.stubsMode(StubRunnerProperties.StubsMode.REMOTE)
 		.repoRoot(StubRunnerRuleSpec.getResource("/m2repo/repository").toURI().toString())
@@ -3071,10 +3073,10 @@ That way the only remaining framework is Spring AMQP.

public interface StubTrigger { /** - * Triggers an event by a given label for a given {@code groupid:artifactid} notation. You can use only {@code artifactId} too. + * Triggers an event by a given label for a given {@code groupid:artifactid} notation. + * You can use only {@code artifactId} too. * * Feature related to messaging. - * * @return true - if managed to run a trigger */ boolean trigger(String ivyNotation, String labelName); @@ -3083,7 +3085,6 @@ That way the only remaining framework is Spring AMQP.

boolean trigger(String labelName); @@ -3092,7 +3093,6 @@ That way the only remaining framework is Spring AMQP.

boolean trigger(); @@ -3103,6 +3103,7 @@ That way the only remaining framework is Spring AMQP.

Map<String, Collection<String>> labels(); + }

For convenience, the StubFinder interface extends StubTrigger, so you only need one or the other in your tests.

StubTrigger gives you the following options to trigger a message:

7.1.1 Trigger by Label

stubFinder.trigger('return_book_1')

7.1.2 Trigger by Group and Artifact Ids

stubFinder.trigger('org.springframework.cloud.contract.verifier.stubs:streamService', 'return_book_1')

7.1.3 Trigger by Artifact Ids

stubFinder.trigger('streamService', 'return_book_1')

7.1.4 Trigger All Messages

stubFinder.trigger()

7.2 Stub Runner Integration

Spring Cloud Contract Verifier Stub Runner’s messaging module gives you an easy way to integrate with Spring Integration. For the provided artifacts, it automatically downloads @@ -3329,20 +3330,20 @@ to disable them explicitly by setting the stubrunner.stre follows:

stubTrigger.trigger("contract-test.person.created.event")

The message has a destination of contract-test.exchange, so the Spring AMQP stub runner integration looks for bindings related to this exchange.

@Bean
 public Binding binding() {
-	return BindingBuilder.bind(new Queue("test.queue")).to(new DirectExchange("contract-test.exchange")).with("#");
+	return BindingBuilder.bind(new Queue("test.queue"))
+			.to(new DirectExchange("contract-test.exchange")).with("#");
 }

The binding definition binds the queue test.queue. As a result, the following listener definition is matched and invoked with the contract message.

@Bean
-public SimpleMessageListenerContainer simpleMessageListenerContainer(ConnectionFactory connectionFactory,
-																		MessageListenerAdapter listenerAdapter) {
+public SimpleMessageListenerContainer simpleMessageListenerContainer(
+		ConnectionFactory connectionFactory,
+		MessageListenerAdapter listenerAdapter) {
 	SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
 	container.setConnectionFactory(connectionFactory);
 	container.setQueueNames("test.queue");
 	container.setMessageListener(listenerAdapter);
 
 	return container;
-}

Also, the following annotated listener matches and is invoked:

@RabbitListener(bindings = @QueueBinding(
-		value = @Queue(value = "test.queue"),
-		exchange = @Exchange(value = "contract-test.exchange", ignoreDeclarationExceptions = "true")))
+}

Also, the following annotated listener matches and is invoked:

@RabbitListener(bindings = @QueueBinding(value = @Queue(value = "test.queue"), exchange = @Exchange(value = "contract-test.exchange", ignoreDeclarationExceptions = "true")))
 public void handlePerson(Person person) {
 	this.person = person;
 }
[Note]Note

The message is directly handed over to the onMessage method of the @@ -5991,21 +5992,23 @@ your test. The following code shows an example:

<
 @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
 @AutoConfigureWireMock(port = 0)
 public class WiremockForDocsTests {
+
 	// A service that calls out over HTTP
-	@Autowired private Service service;
+	@Autowired
+	private Service service;
 
 	// Using the WireMock APIs in the normal way:
 	@Test
 	public void contextLoads() throws Exception {
 		// Stubbing WireMock
-		stubFor(get(urlEqualTo("/resource"))
-				.willReturn(aResponse().withHeader("Content-Type", "text/plain").withBody("Hello World!")));
+		stubFor(get(urlEqualTo("/resource")).willReturn(aResponse()
+				.withHeader("Content-Type", "text/plain").withBody("Hello World!")));
 		// We're asserting if WireMock responded properly
 		assertThat(this.service.go()).isEqualTo("Hello World!");
 	}
 
 }
-//end::wiremock_test2[]

To start the stub server on a different port use (for example), +// end::wiremock_test2[]

To start the stub server on a different port use (for example), @AutoConfigureWireMock(port=9999). For a random port, use a value of 0. The stub server port can be bound in the test application context with the "wiremock.server.port" property. Using @AutoConfigureWireMock adds a bean of type WiremockConfiguration to @@ -6051,6 +6054,7 @@ instance, as shown in the following example:


 	@ClassRule
 	public static WireMockClassRule wiremock = new WireMockClassRule(
 			WireMockSpring.options().dynamicPort());
+
 	// A service that calls out over HTTP to localhost:${wiremock.port}
 	@Autowired
 	private Service service;
@@ -6059,14 +6063,14 @@ instance, as shown in the following example:


 	@Test
 	public void contextLoads() throws Exception {
 		// Stubbing WireMock
-		wiremock.stubFor(get(urlEqualTo("/resource"))
-				.willReturn(aResponse().withHeader("Content-Type", "text/plain").withBody("Hello World!")));
+		wiremock.stubFor(get(urlEqualTo("/resource")).willReturn(aResponse()
+				.withHeader("Content-Type", "text/plain").withBody("Hello World!")));
 		// We're asserting if WireMock responded properly
 		assertThat(this.service.go()).isEqualTo("Hello World!");
 	}
 
 }
-//end::wiremock_test2[]

The @ClassRule means that the server shuts down after all the methods in this class +// end::wiremock_test2[]

The @ClassRule means that the server shuts down after all the methods in this class have been run.

11.4 Relaxed SSL Validation for Rest Template

WireMock lets you stub a "secure" server with an "https" URL protocol. If your application wants to contact that stub server in an integration test, it will find that the SSL certificates are not valid (the usual problem with self-installed certificates). @@ -6115,6 +6119,7 @@ a Spring MockRestServiceServer. The following code assertThat(this.service.go()).isEqualTo("Hello World"); server.verify(); } + }

The baseUrl value is prepended to all mock calls, and the stubs() method takes a stub path resource pattern as an argument. In the preceding example, the stub defined at /stubs/resource.json is loaded into the mock server. If the RestTemplate is asked to @@ -6127,9 +6132,11 @@ Spring Boot embedded servers, and Wiremock itself has "native" support for a par version of Jetty (currently 9.2). To use the native Jetty, you need to add the native Wiremock dependencies and exclude the Spring Boot container (if there is one).

11.6 Customization of WireMock configuration

You can register a bean of org.springframework.cloud.contract.wiremock.WireMockConfigurationCustomizer type in order to customize the WireMock configuration (e.g. add custom transformers). -Example:

		@Bean WireMockConfigurationCustomizer optionsCustomizer() {
+Example:

		@Bean
+		WireMockConfigurationCustomizer optionsCustomizer() {
 			return new WireMockConfigurationCustomizer() {
-				@Override public void customize(WireMockConfiguration options) {
+				@Override
+				public void customize(WireMockConfiguration options) {
 // perform your customization here
 				}
 			};
@@ -6243,16 +6250,14 @@ about a situation in which they would like to move to DSL-based contract definit
 but they already have a lot of Spring MVC tests. Using this feature lets you generate
 the contract files that you can later modify and move to folders (defined in your
 configuration) so that the plugin finds them.

[Tip]Tip

You might wonder why this functionality is in the WireMock module. The functionality -is there because it makes sense to generate both the contracts and the stubs.

Consider the following test:

		this.mockMvc.perform(post("/foo")
-					.accept(MediaType.APPLICATION_PDF)
-					.accept(MediaType.APPLICATION_JSON)
-					.contentType(MediaType.APPLICATION_JSON)
-					.content("{\"foo\": 23, \"bar\" : \"baz\" }"))
-				.andExpect(status().isOk())
-				.andExpect(content().string("bar"))
+is there because it makes sense to generate both the contracts and the stubs.

Consider the following test:

		this.mockMvc
+				.perform(post("/foo").accept(MediaType.APPLICATION_PDF)
+						.accept(MediaType.APPLICATION_JSON)
+						.contentType(MediaType.APPLICATION_JSON)
+						.content("{\"foo\": 23, \"bar\" : \"baz\" }"))
+				.andExpect(status().isOk()).andExpect(content().string("bar"))
 				// first WireMock
-				.andDo(WireMockRestDocs.verify()
-						.jsonPath("$[?(@.foo >= 20)]")
+				.andDo(WireMockRestDocs.verify().jsonPath("$[?(@.foo >= 20)]")
 						.jsonPath("$[?(@.bar in ['baz','bazz','bazzz'])]")
 						.contentType(MediaType.valueOf("application/json"))
 						.stub("shouldGrantABeerIfOldEnough"))
diff --git a/spring-cloud-contract-maven-plugin/checkstyle.html b/spring-cloud-contract-maven-plugin/checkstyle.html
index 31b6f60d58..88ed24d9e3 100644
--- a/spring-cloud-contract-maven-plugin/checkstyle.html
+++ b/spring-cloud-contract-maven-plugin/checkstyle.html
@@ -285,7 +285,7 @@
 12
 0
 0
-545
+557 +19

Rules

@@ -370,7 +370,7 @@ - + @@ -435,7 +435,7 @@ - + @@ -451,16 +451,6 @@ - - - - - - - - - -
RightCurly412  Error
coding
sizes LineLength216231  Error
NoWhitespaceAfter 1 Error
OperatorWrap10 Error
WhitespaceAround1  Error

Details

@@ -481,165 +471,153 @@ 3  Error +sizes +LineLength +Line is longer than 80 characters (found 87). +4 + + Error whitespace FileTabCharacter File contains tab characters (this is the first instance). 12 - +  Error javadoc JavadocVariable Missing a Javadoc comment. 12 - +  Error javadoc JavadocVariable Missing a Javadoc comment. 14 - +  Error design DesignForExtension Class 'BaseClassMapping' looks like designed for extension (can be subclassed), but the method 'getContractPackageRegex' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'BaseClassMapping' final or making the method 'getContractPackageRegex' static/final/abstract/empty, or adding allowed annotation for the method. 16 - +  Error javadoc JavadocMethod Missing a Javadoc comment. 16 - +  Error design DesignForExtension Class 'BaseClassMapping' looks like designed for extension (can be subclassed), but the method 'setContractPackageRegex' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'BaseClassMapping' final or making the method 'setContractPackageRegex' static/final/abstract/empty, or adding allowed annotation for the method. 20 - +  Error javadoc JavadocMethod Missing a Javadoc comment. 20 - +  Error misc FinalParameters Parameter contractPackageRegex should be final. 20 - +  Error coding HiddenField 'contractPackageRegex' hides a field. 20 - +  Error design DesignForExtension Class 'BaseClassMapping' looks like designed for extension (can be subclassed), but the method 'getBaseClassFQN' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'BaseClassMapping' final or making the method 'getBaseClassFQN' static/final/abstract/empty, or adding allowed annotation for the method. 24 - +  Error javadoc JavadocMethod Missing a Javadoc comment. 24 - +  Error design DesignForExtension Class 'BaseClassMapping' looks like designed for extension (can be subclassed), but the method 'setBaseClassFQN' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'BaseClassMapping' final or making the method 'setBaseClassFQN' static/final/abstract/empty, or adding allowed annotation for the method. 28 - +  Error javadoc JavadocMethod Missing a Javadoc comment. 28 - +  Error misc FinalParameters Parameter baseClassFQN should be final. 28 - +  Error coding HiddenField 'baseClassFQN' hides a field. 28 - +  Error design DesignForExtension Class 'BaseClassMapping' looks like designed for extension (can be subclassed), but the method 'equals' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'BaseClassMapping' final or making the method 'equals' static/final/abstract/empty, or adding allowed annotation for the method. 32 - +  Error misc FinalParameters Parameter o should be final. -32 - - Error -blocks -NeedBraces -'if' construct must use '{}'s. 33  Error blocks NeedBraces 'if' construct must use '{}'s. -35 +34  Error blocks NeedBraces 'if' construct must use '{}'s. -38 +36  Error -whitespace -OperatorWrap -'?' should be on a new line. -38 +blocks +NeedBraces +'if' construct must use '{}'s. +39  Error -coding -AvoidInlineConditionals -Avoid inline conditionals. -38 - - Error sizes LineLength Line is longer than 80 characters (found 94). -39 - - Error -whitespace -OperatorWrap -':' should be on a new line. -39 +40  Error -whitespace -OperatorWrap -'?' should be on a new line. -42 - - Error coding AvoidInlineConditionals Avoid inline conditionals. -42 +40 + + Error +sizes +LineLength +Line is longer than 80 characters (found 94). +43  Error -whitespace -OperatorWrap -':' should be on a new line. +coding +AvoidInlineConditionals +Avoid inline conditionals. 43  Error @@ -649,85 +627,85 @@ 48  Error -sizes -LineLength -Line is longer than 80 characters (found 106). -49 - - Error coding AvoidInlineConditionals Avoid inline conditionals. -49 - - Error -sizes -LineLength -Line is longer than 80 characters (found 102). -50 +51  Error coding MagicNumber '31' is a magic number. -50 - - Error -coding -AvoidInlineConditionals -Avoid inline conditionals. -50 - - Error -design -DesignForExtension -Class 'BaseClassMapping' looks like designed for extension (can be subclassed), but the method 'toString' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'BaseClassMapping' final or making the method 'toString' static/final/abstract/empty, or adding allowed annotation for the method. -54 +52  Error sizes LineLength Line is longer than 80 characters (found 97). -55 +53 + + Error +coding +AvoidInlineConditionals +Avoid inline conditionals. +53 + + Error +design +DesignForExtension +Class 'BaseClassMapping' looks like designed for extension (can be subclassed), but the method 'toString' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'BaseClassMapping' final or making the method 'toString' static/final/abstract/empty, or adding allowed annotation for the method. +57  Error sizes LineLength +Line is longer than 80 characters (found 97). +59 + + Error +sizes +LineLength Line is longer than 80 characters (found 93). -56
+60

org/springframework/cloud/contract/maven/verifier/ConvertMojo.java

- + - + + + + + + + - - - - - - - + - + + + + + + + @@ -756,32 +734,20 @@ - + - - - - - - - + - - - - - - - - + + @@ -814,82 +780,82 @@ - - - - - - - - - - - - - + + + + + + + - - - - - - - + - + + + + + + + - - + + - - - + + + - - + + - - - + + + - + + + + + + + - + @@ -898,373 +864,349 @@ + + + + + + - + - - - - - - - - + + - + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - + + - - + + - - + + + + + + + + - - + + - - + + - - - - - - - + - - + + - - - + + + - - + + - + - + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - + + - + + + + + + + + + + + + + - + - + - - + + - + - + - + - + - - - - - - - - + + -
Severity Category Rule Message Line
 Error sizes LineLength Line is longer than 80 characters (found 81). 40
 ErrorsizesLineLengthLine is longer than 80 characters (found 86).42
 Error sizes LineLengthLine is longer than 80 characters (found 120).42
 ErrorwhitespaceFileTabCharacterFile contains tab characters (this is the first instance).Line is longer than 80 characters (found 102). 45
 Error sizes LineLength Line is longer than 80 characters (found 84). 48
 ErrorwhitespaceFileTabCharacterFile contains tab characters (this is the first instance).48
 Error javadoc Error sizes LineLengthLine is longer than 80 characters (found 100).Line is longer than 80 characters (found 90). 55
 Error sizes LineLengthLine is longer than 80 characters (found 82).57
 ErrorsizesLineLengthLine is longer than 80 characters (found 89).Line is longer than 80 characters (found 148). 58
 ErrorsizesLineLengthLine is longer than 80 characters (found 89).62
 Error sizes LineLengthLine is longer than 80 characters (found 84).63
Line is longer than 80 characters (found 93).62
 Error sizes82
 ErrorsizesLineLengthLine is longer than 80 characters (found 94).85
 Error javadoc JavadocVariable Missing a Javadoc comment. 85
 ErrorsizesLineLengthLine is longer than 80 characters (found 99).88
 Error sizes LineLengthLine is longer than 80 characters (found 113).Line is longer than 80 characters (found 90). 89
 ErrorsizesLineLengthLine is longer than 80 characters (found 87).90
 Error javadoc JavadocVariable Missing a Javadoc comment.95
 ErrorsizesLineLengthLine is longer than 80 characters (found 102).99
96
 Error sizes LineLengthLine is longer than 80 characters (found 83).Line is longer than 80 characters (found 89). 100
 ErrorsizesLineLengthLine is longer than 80 characters (found 87).101
 Error javadoc JavadocStyle Extra HTML tag found: </p>101
103
 Error sizes LineLengthLine is longer than 80 characters (found 125).102
Line is longer than 80 characters (found 94).104
 Error javadoc JavadocStyle First sentence should end with a period.108
110
 Error sizes LineLengthLine is longer than 80 characters (found 103).115
Line is longer than 80 characters (found 88).117
 Error javadoc JavadocStyle First sentence should end with a period.145
147
 ErrorsizesLineLengthLine is longer than 80 characters (found 92).148
 Error sizes LineLength Line is longer than 80 characters (found 83).151
152
 Error javadoc156
 ErrorsizesLineLengthLine is longer than 80 characters (found 94).157
 Error javadoc JavadocStyle First sentence should end with a period. 163
 Error sizes LineLengthLine is longer than 80 characters (found 133).164
 ErrorjavadocJavadocVariableMissing a Javadoc comment.169
Line is longer than 80 characters (found 86).165
 Error javadoc JavadocVariable Missing a Javadoc comment.172
170
 Error javadocJavadocVariableMissing a Javadoc comment.173
 Errorjavadoc JavadocMethod Missing a Javadoc comment.174
175
 Error sizes LineLength Line is longer than 80 characters (found 85).175
176
 Error misc FinalParameters Parameter aetherStubDownloaderFactory should be final.175
176
 Error coding HiddenField 'aetherStubDownloaderFactory' hides a field.175
176
 Error design DesignForExtension Class 'ConvertMojo' looks like designed for extension (can be subclassed), but the method 'execute' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'ConvertMojo' final or making the method 'execute' static/final/abstract/empty, or adding allowed annotation for the method.179
180
 Error javadoc JavadocMethod Missing a Javadoc comment.179
180
 Error sizes LineLength Line is longer than 80 characters (found 132).182
183
 Error sizes LineLength Line is longer than 80 characters (found 91).189
190
 Error sizes LineLength Line is longer than 80 characters (found 97).191
192
 Error coding HiddenField 'contractsDirectory' hides a field.193
 ErrorsizesLineLengthLine is longer than 80 characters (found 100). 194
 Error sizes LineLengthLine is longer than 80 characters (found 84).195
Line is longer than 80 characters (found 102).196
 Error sizes LineLengthLine is longer than 80 characters (found 104).196
Line is longer than 80 characters (found 84).197
 Error sizes LineLengthLine is longer than 80 characters (found 89).197
Line is longer than 80 characters (found 96).198
 Error sizes LineLengthLine is longer than 80 characters (found 96).199
 ErrorsizesLineLength Line is longer than 80 characters (found 88).202
204
 Error sizes LineLength Line is longer than 80 characters (found 94).206
208
 Error javadoc JavadocMethod Missing a Javadoc comment.206
 ErrormiscFinalParametersParameter config should be final.206
208
 Error misc FinalParametersParameter contractsDslDir should be final.206
Parameter config should be final.208
 ErrorsizesLineLengthLine is longer than 80 characters (found 93).miscFinalParametersParameter contractsDslDir should be final. 208
 Error sizes LineLengthLine is longer than 80 characters (found 119).211
Line is longer than 80 characters (found 93).210
 Error sizes LineLengthLine is longer than 80 characters (found 94).Line is longer than 80 characters (found 119). 213
 Error sizes LineLengthLine is longer than 80 characters (found 87).Line is longer than 80 characters (found 94). 215
 ErrorsizesLineLengthLine is longer than 80 characters (found 87).217
 Error javadoc JavadocMethod Missing a Javadoc comment.219
221
 Error misc FinalParameters Parameter contractsDirectory should be final.219
221
 Error coding HiddenField 'contractsDirectory' hides a field.219
221
 Error sizes LineLength Line is longer than 80 characters (found 84).220
222
 Error sizes LineLength Line is longer than 80 characters (found 123).224
226
 Error sizes LineLength Line is longer than 80 characters (found 83).231
233
 Error javadoc JavadocMethod Missing a Javadoc comment.231
233
 Error misc FinalParameters Parameter config should be final.231
233
 Error sizes LineLength Line is longer than 80 characters (found 90).232
 ErrorsizesLineLengthLine is longer than 80 characters (found 118).233
 ErrorsizesLineLengthLine is longer than 80 characters (found 107). 234
 ErrorsizesLineLengthLine is longer than 80 characters (found 109).235
 Error sizes LineLengthLine is longer than 80 characters (found 92).236
Line is longer than 80 characters (found 100).235
 Error sizes LineLengthLine is longer than 80 characters (found 111).Line is longer than 80 characters (found 100). 237
 ErrorsizesLineLengthLine is longer than 80 characters (found 93).238
 ErrorsizesLineLengthLine is longer than 80 characters (found 102).239
 Error javadoc JavadocMethod Missing a Javadoc comment.240
243
 Error misc FinalParameters Parameter rootPath should be final.240
243
 Error sizes LineLengthLine is longer than 80 characters (found 118).241
Line is longer than 80 characters (found 98).244
 Error coding AvoidInlineConditionals Avoid inline conditionals.241
244
 Error javadoc JavadocMethod Missing a Javadoc comment.244
248
 Error misc FinalParameters Parameter contractsDirectory should be final.244
248
 Error coding HiddenField 'contractsDirectory' hides a field.244
248
 ErrorwhitespaceOperatorWrap'?' should be on a new line.245
 Error coding AvoidInlineConditionals Avoid inline conditionals.245
249
 Error javadoc JavadocMethod Missing a Javadoc comment.249
+252

org/springframework/cloud/contract/maven/verifier/CopyContracts.java

- + - + - + - - + + - - - - - - - - - - - - - - - - - - - + - - - - + + + + - + @@ -1274,249 +1216,261 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - + + + + - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - + - - + + + + + + + + + + + + + + - + + + + + + + + + + + + + - + - + - + - + - + - + - + + + + + + + + + + + + + - + - - - - - - - - + + - - + + - - + + - + + + + + + + + + + + + + - - - - - - - + - + -
Severity Category Rule Message Line
 Error javadoc JavadocType Missing a Javadoc comment. 32
 Error sizes LineLength Line is longer than 80 characters (found 87).33
34
 Error whitespace FileTabCharacter File contains tab characters (this is the first instance).33
 ErrorjavadocJavadocVariableMissing a Javadoc comment.33
 ErrornamingConstantNameName 'log' must match pattern '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.33
 ErrorjavadocJavadocVariableMissing a Javadoc comment. 34
 Error javadoc JavadocVariable Missing a Javadoc comment.35
34
 ErrorjavadocJavadocVariableMissing a Javadoc comment.36
namingConstantNameName 'log' must match pattern '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.34
 Error javadoc JavadocVariable Missing a Javadoc comment.37
36
 Error javadoc
 Error javadocJavadocMethodJavadocVariable Missing a Javadoc comment. 40
 ErrormiscFinalParametersParameter project should be final.40
 ErrorcodingHiddenField'project' hides a field.40
 ErrormiscFinalParametersParameter mavenSession should be final.40
 ErrorcodingHiddenField'mavenSession' hides a field.40
 ErrormiscFinalParametersParameter mavenResourcesFiltering should be final.41
 ErrorcodingHiddenField'mavenResourcesFiltering' hides a field.41
 ErrormiscFinalParametersParameter config should be final.javadocJavadocVariableMissing a Javadoc comment. 42
 ErrorcodingHiddenField'config' hides a field.42
javadocJavadocVariableMissing a Javadoc comment.44
 ErrorsizesLineLengthLine is longer than 80 characters (found 88).49
 Error javadoc JavadocMethod Missing a Javadoc comment.49
46
 ErrormiscFinalParametersParameter project should be final.46
 ErrorcodingHiddenField'project' hides a field.46
 ErrormiscFinalParametersParameter mavenSession should be final.46
 ErrorcodingHiddenField'mavenSession' hides a field.46
 ErrormiscFinalParametersParameter mavenResourcesFiltering should be final.47
 ErrorcodingHiddenField'mavenResourcesFiltering' hides a field.47
 ErrormiscFinalParametersParameter config should be final.48
 ErrorcodingHiddenField'config' hides a field.48
 ErrorsizesLineLengthLine is longer than 80 characters (found 88).55
 ErrorjavadocJavadocMethodMissing a Javadoc comment.55
 Error misc FinalParameters Parameter contractsDirectory should be final.49
55
 Error misc FinalParameters Parameter outputDirectory should be final.49
55
 Error misc FinalParameters Parameter rootPath should be final.49
 ErrorsizesLineLengthLine is longer than 80 characters (found 98).51
 ErrorwhitespaceOperatorWrap'?' should be on a new line.51
 ErrorcodingAvoidInlineConditionalsAvoid inline conditionals.51
55
 Error sizes LineLengthLine is longer than 80 characters (found 103).52
 ErrorsizesLineLengthLine is longer than 80 characters (found 113).53
 ErrorwhitespaceWhitespaceAround'+' is not preceded with whitespace.53
 ErrorsizesLineLengthLine is longer than 80 characters (found 126).54
 ErrorsizesLineLengthLine is longer than 80 characters (found 108).Line is longer than 80 characters (found 96). 57
 Error sizes LineLengthLine is longer than 80 characters (found 94).59
Line is longer than 80 characters (found 105).58
 ErrorcodingAvoidInlineConditionalsAvoid inline conditionals.58
 ErrorsizesLineLengthLine is longer than 80 characters (found 93).60
 Error sizes LineLengthLine is longer than 80 characters (found 92).Line is longer than 80 characters (found 98). 61
 Error sizes LineLengthLine is longer than 80 characters (found 89).66
 ErrorsizesLineLengthLine is longer than 80 characters (found 85).68
 ErrorsizesLineLength Line is longer than 80 characters (found 93).64
72
 Error sizes LineLength Line is longer than 80 characters (found 82).73
81
 Error blocks RightCurly '}' at column 3 should be on the same line as the next part of a multi-block statement (one that directly contains multiple blocks: if/else-if/else, do/while or try/catch/finally).85
93
 Error sizes LineLength Line is longer than 80 characters (found 93).91
99
 Error javadoc JavadocMethod Missing a Javadoc comment.91
99
 Error misc FinalParameters Parameter includedRootFolderAntPattern should be final.91
99
 Error sizes LineLength Line is longer than 80 characters (found 85).92
100
 ErrorblocksRightCurly'}' at column 3 should be on the same line as the next part of a multi-block statement (one that directly contains multiple blocks: if/else-if/else, do/while or try/catch/finally).102
 ErrorsizesLineLengthLine is longer than 80 characters (found 88).103
 Error sizes LineLength Line is longer than 80 characters (found 90).94
104
 Error sizes LineLengthLine is longer than 80 characters (found 116).95
 ErrorsizesLineLength Line is longer than 80 characters (found 91).100
110
 Error javadoc JavadocMethod Missing a Javadoc comment.100
110
 Error misc FinalParameters Parameter includedRootFolderAntPattern should be final.100
110
 Error sizes LineLength Line is longer than 80 characters (found 83).101
111
 ErrorblocksRightCurly'}' at column 3 should be on the same line as the next part of a multi-block statement (one that directly contains multiple blocks: if/else-if/else, do/while or try/catch/finally).113
 Error sizes LineLengthLine is longer than 80 characters (found 90).114
 ErrorsizesLineLength Line is longer than 80 characters (found 92).103
 ErrorsizesLineLengthLine is longer than 80 characters (found 116).104
115
 Error javadoc JavadocMethod Missing a Javadoc comment.109
121
 Error javadoc JavadocMethod Missing a Javadoc comment.113
+125

org/springframework/cloud/contract/maven/verifier/GenerateStubsMojo.java

@@ -1530,14 +1484,26 @@ - + + + + + + + + + + + + + - + @@ -1546,27 +1512,270 @@ + + + + + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 Error sizes LineLengthLine is longer than 80 characters (found 91).Line is longer than 80 characters (found 85). 36
 ErrorsizesLineLengthLine is longer than 80 characters (found 92).39
 ErrorsizesLineLengthLine is longer than 80 characters (found 97).42
 Error whitespace FileTabCharacter File contains tab characters (this is the first instance).39
42
 Error javadoc42
 ErrorsizesLineLengthLine is longer than 80 characters (found 98).45
 Error javadoc JavadocVariable Missing a Javadoc comment.46
45
 Error javadoc JavadocStyle First sentence should end with a period.50
48
 Error sizes LineLength Line is longer than 80 characters (found 92).53
51
 ErrorjavadocJavadocStyleFirst sentence should end with a period.54
 ErrorsizesLineLengthLine is longer than 80 characters (found 96).57
 ErrorjavadocJavadocVariableMissing a Javadoc comment.60
 Error javadoc JavadocStyle First sentence should end with a period.63
 ErrorjavadocJavadocVariableMissing a Javadoc comment.69
 ErrorjavadocJavadocVariableMissing a Javadoc comment.72
 ErrorjavadocJavadocVariableMissing a Javadoc comment.75
 ErrorsizesLineLengthLine is longer than 80 characters (found 83).78
 ErrordesignDesignForExtensionClass 'GenerateStubsMojo' looks like designed for extension (can be subclassed), but the method 'execute' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'GenerateStubsMojo' final or making the method 'execute' static/final/abstract/empty, or adding allowed annotation for the method.78
 ErrorjavadocJavadocMethodMissing a Javadoc comment.78
 ErrorsizesLineLengthLine is longer than 80 characters (found 129).81
 ErrorsizesLineLengthLine is longer than 80 characters (found 114).82
 ErrorsizesLineLengthLine is longer than 80 characters (found 87).87
 ErrorjavadocJavadocMethodMissing a Javadoc comment.91
 ErrormiscFinalParametersParameter stubsOutputDir should be final.91
 ErrorsizesLineLengthLine is longer than 80 characters (found 86).94
 ErrorsizesLineLengthLine is longer than 80 characters (found 114).96
 ErrorsizesLineLengthLine is longer than 80 characters (found 85).98
 ErrorsizesLineLengthLine is longer than 80 characters (found 90).100
 ErrorsizesLineLengthLine is longer than 80 characters (found 82).102
 ErrorsizesLineLengthLine is longer than 80 characters (found 83).103
 ErrorsizesLineLengthLine is longer than 80 characters (found 93).105
 ErrorwhitespaceNoWhitespaceAfter'{' is followed by whitespace.105
 ErrorsizesLineLengthLine is longer than 80 characters (found 99).106
 ErrorcodingAvoidInlineConditionalsAvoid inline conditionals.106
 ErrorsizesLineLengthLine is longer than 80 characters (found 109).110
 ErrorblocksRightCurly'}' at column 3 should be on the same line as the next part of a multi-block statement (one that directly contains multiple blocks: if/else-if/else, do/while or try/catch/finally).112
 ErrorsizesLineLengthLine is longer than 80 characters (found 101).115
 ErrorjavadocJavadocMethodMissing a Javadoc comment.120
 ErrorjavadocJavadocMethodMissing a Javadoc comment.130
 ErrorsizesLineLengthLine is longer than 80 characters (found 84).131
+
+

org/springframework/cloud/contract/maven/verifier/GenerateTestsMojo.java

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1579,243 +1788,12 @@ - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
SeverityCategoryRuleMessageLine
 ErrorjavadocJavadocPackageMissing package-info.java file.
 ErrorjavadocJavadocStyleFirst sentence should end with a period.46
 ErrorsizesLineLengthLine is longer than 80 characters (found 83).47
 ErrorsizesLineLengthLine is longer than 80 characters (found 135).50
 ErrorwhitespaceFileTabCharacterFile contains tab characters (this is the first instance).53
 ErrorjavadocJavadocVariableMissing a Javadoc comment.53
 ErrorsizesLineLengthLine is longer than 80 characters (found 148).56
 ErrorjavadocJavadocVariableMissing a Javadoc comment. 56
 Errorjavadoc JavadocVariable Missing a Javadoc comment.62
 ErrorjavadocJavadocStyleFirst sentence should end with a period.65
 ErrorjavadocJavadocVariableMissing a Javadoc comment.71
59
 Error javadoc JavadocVariable Missing a Javadoc comment.74
 ErrorjavadocJavadocVariableMissing a Javadoc comment.77
 ErrorsizesLineLengthLine is longer than 80 characters (found 83).80
 ErrordesignDesignForExtensionClass 'GenerateStubsMojo' looks like designed for extension (can be subclassed), but the method 'execute' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'GenerateStubsMojo' final or making the method 'execute' static/final/abstract/empty, or adding allowed annotation for the method.80
 ErrorjavadocJavadocMethodMissing a Javadoc comment.80
 ErrorsizesLineLengthLine is longer than 80 characters (found 129).83
 ErrorsizesLineLengthLine is longer than 80 characters (found 131).84
 ErrorsizesLineLengthLine is longer than 80 characters (found 102).88
 ErrorjavadocJavadocMethodMissing a Javadoc comment.91
 ErrormiscFinalParametersParameter stubsOutputDir should be final.91
 ErrorsizesLineLengthLine is longer than 80 characters (found 104).95
 ErrorsizesLineLengthLine is longer than 80 characters (found 130).96
 ErrorsizesLineLengthLine is longer than 80 characters (found 104).99
 ErrorsizesLineLengthLine is longer than 80 characters (found 90).100
 ErrorsizesLineLengthLine is longer than 80 characters (found 82).102
 ErrorsizesLineLengthLine is longer than 80 characters (found 83).103
 ErrorsizesLineLengthLine is longer than 80 characters (found 93).105
 ErrorwhitespaceNoWhitespaceAfter'{' is followed by whitespace.105
 ErrorsizesLineLengthLine is longer than 80 characters (found 99).106
 ErrorcodingAvoidInlineConditionalsAvoid inline conditionals.106
 ErrorsizesLineLengthLine is longer than 80 characters (found 106).109
 ErrorblocksRightCurly'}' at column 3 should be on the same line as the next part of a multi-block statement (one that directly contains multiple blocks: if/else-if/else, do/while or try/catch/finally).111
 ErrorsizesLineLengthLine is longer than 80 characters (found 101).114
 ErrorjavadocJavadocMethodMissing a Javadoc comment.119
 ErrorjavadocJavadocMethodMissing a Javadoc comment.129
 ErrorsizesLineLengthLine is longer than 80 characters (found 84).130
-
-

org/springframework/cloud/contract/maven/verifier/GenerateTestsMojo.java

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -1850,291 +1828,279 @@ - - + + - + - + - + - - - - - - + + + + + + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + - + - - - - + + + + - - - - + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - @@ -2145,278 +2111,326 @@ - - + + - - - + + + - - + + - + - - - - + + + + - - - - - - - - - - - - - + - - + + - - + + - - + + + + + + + + + + + + + + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + -
SeverityCategoryRuleMessageLine
 ErrorjavadocJavadocPackageMissing package-info.java file.
 ErrorjavadocJavadocStyleFirst sentence should end with a period.46
 ErrorsizesLineLengthLine is longer than 80 characters (found 82).50
 ErrorwhitespaceFileTabCharacterFile contains tab characters (this is the first instance).51
 ErrorjavadocJavadocVariableMissing a Javadoc comment.54
 ErrorsizesLineLengthLine is longer than 80 characters (found 82).57
 ErrorjavadocJavadocVariableMissing a Javadoc comment.57
 ErrorsizesLineLengthLine is longer than 80 characters (found 89).58
 ErrorjavadocJavadocVariableMissing a Javadoc comment.61
 ErrorsizesLineLengthLine is longer than 80 characters (found 101). 62
 Error
 Error javadocJavadocVariableMissing a Javadoc comment.JavadocStyleFirst sentence should end with a period. 80
 Error javadoc JavadocStyle First sentence should end with a period.83
86
 Error javadoc JavadocStyle First sentence should end with a period.89
92
 Error javadoc JavadocStyle First sentence should end with a period.95
98
 ErrorjavadocJavadocStyleFirst sentence should end with a period.101
 Error sizes LineLength Line is longer than 80 characters (found 86).105
 ErrorsizesLineLengthLine is longer than 80 characters (found 99). 108
 Error javadoc JavadocStyle First sentence should end with a period.115
111
 Error sizes LineLength Line is longer than 80 characters (found 91).116
112
 Error javadoc JavadocVariable Missing a Javadoc comment.121
117
 Error sizes LineLength Line is longer than 80 characters (found 92).124
120
 Error javadoc JavadocVariable Missing a Javadoc comment.124
120
 Error javadoc JavadocVariable Missing a Javadoc comment.127
123
 ErrorsizesLineLengthLine is longer than 80 characters (found 93).130
 Error javadoc JavadocVariable Missing a Javadoc comment.130
 ErrorsizesLineLengthLine is longer than 80 characters (found 113).134
 ErrorjavadocJavadocVariableMissing a Javadoc comment.140
 ErrorsizesLineLengthLine is longer than 80 characters (found 102).144
 ErrorsizesLineLengthLine is longer than 80 characters (found 83).145
 ErrorjavadocJavadocStyleExtra HTML tag found: </p>146
 ErrorsizesLineLengthLine is longer than 80 characters (found 125).147
 ErrorjavadocJavadocStyleFirst sentence should end with a period.153
 ErrorsizesLineLengthLine is longer than 80 characters (found 114).160
 ErrorsizesLineLengthLine is longer than 80 characters (found 114).161
 ErrorsizesLineLengthLine is longer than 80 characters (found 107).162
 ErrorsizesLineLengthLine is longer than 80 characters (found 109).163
126
 Error sizes LineLength Line is longer than 80 characters (found 84).164
130
 Error sizes LineLengthLine is longer than 80 characters (found 122).170
Line is longer than 80 characters (found 88).131
 Error javadocJavadocStyleExtra HTML tag found: </p>172
 ErrorjavadocJavadocStyleExtra HTML tag found: </p>174
 ErrorjavadocJavadocStyleExtra HTML tag found: </p>176
 ErrorsizesLineLengthLine is longer than 80 characters (found 113).177
 ErrorjavadocJavadocStyleFirst sentence should end with a period.207
 ErrorsizesLineLengthLine is longer than 80 characters (found 83).213
 ErrorjavadocJavadocStyleFirst sentence should end with a period.217
 ErrorjavadocJavadocStyleFirst sentence should end with a period.224
 ErrorsizesLineLengthLine is longer than 80 characters (found 133).225
 Errorjavadoc JavadocVariable Missing a Javadoc comment.230
137
 ErrorsizesLineLengthLine is longer than 80 characters (found 89).141
 ErrorsizesLineLengthLine is longer than 80 characters (found 87).142
 ErrorjavadocJavadocStyleExtra HTML tag found: </p>144
 ErrorsizesLineLengthLine is longer than 80 characters (found 94).145
 ErrorjavadocJavadocStyleFirst sentence should end with a period.151
 ErrorsizesLineLengthLine is longer than 80 characters (found 92).158
 ErrorsizesLineLengthLine is longer than 80 characters (found 93).159
 ErrorsizesLineLengthLine is longer than 80 characters (found 93).161
 ErrorsizesLineLengthLine is longer than 80 characters (found 89).163
 ErrorsizesLineLengthLine is longer than 80 characters (found 93).170
 ErrorsizesLineLengthLine is longer than 80 characters (found 89).171
 Error javadocJavadocMethodMissing a Javadoc comment.232
JavadocStyleExtra HTML tag found: </p>173
 ErrorjavadocJavadocStyleExtra HTML tag found: </p>175
 ErrorjavadocJavadocStyleExtra HTML tag found: </p>177
 Error sizes LineLength Line is longer than 80 characters (found 91).233
178
 ErrormiscFinalParametersParameter aetherStubDownloaderFactory should be final.233
javadocJavadocStyleFirst sentence should end with a period.209
 ErrorcodingHiddenField'aetherStubDownloaderFactory' hides a field.233
sizesLineLengthLine is longer than 80 characters (found 92).210
 Error sizes LineLength Line is longer than 80 characters (found 83).237
214
 ErrorjavadocJavadocStyleFirst sentence should end with a period.218
 ErrorsizesLineLengthLine is longer than 80 characters (found 94).219
 ErrorjavadocJavadocStyleFirst sentence should end with a period.225
 ErrorsizesLineLengthLine is longer than 80 characters (found 86).227
 ErrorjavadocJavadocVariableMissing a Javadoc comment.232
 ErrorjavadocJavadocMethodMissing a Javadoc comment.234
 ErrorsizesLineLengthLine is longer than 80 characters (found 91).235
 ErrormiscFinalParametersParameter aetherStubDownloaderFactory should be final.235
 ErrorcodingHiddenField'aetherStubDownloaderFactory' hides a field.235
 ErrorsizesLineLengthLine is longer than 80 characters (found 83).239
 Error design DesignForExtension Class 'GenerateTestsMojo' looks like designed for extension (can be subclassed), but the method 'execute' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'GenerateTestsMojo' final or making the method 'execute' static/final/abstract/empty, or adding allowed annotation for the method.237
239
 Error javadoc JavadocMethod Missing a Javadoc comment.237
 ErrorblocksNeedBraces'if' construct must use '{}'s. 239
 ErrorsizesLineLengthLine is longer than 80 characters (found 156).239
 ErrorblocksNeedBraces'if' construct must use '{}'s.240
 ErrorsizesLineLengthLine is longer than 80 characters (found 154).240
 Error blocks Error sizes LineLengthLine is longer than 80 characters (found 139).241
Line is longer than 80 characters (found 137).243
 ErrorsizesLineLengthLine is longer than 80 characters (found 128).blocksNeedBraces'if' construct must use '{}'s. 245
 Error sizes LineLengthLine is longer than 80 characters (found 103).246
Line is longer than 80 characters (found 117).247
 Error sizes LineLengthLine is longer than 80 characters (found 109).Line is longer than 80 characters (found 86). 248
 ErrorcodingHiddenField'contractsDirectory' hides a field.248
blocksNeedBraces'if' construct must use '{}'s.249
 Error sizes LineLength Line is longer than 80 characters (found 110).249
 ErrorsizesLineLengthLine is longer than 80 characters (found 99).250
 ErrorsizesLineLengthLine is longer than 80 characters (found 101). 251
 Error sizes LineLengthLine is longer than 80 characters (found 155).Line is longer than 80 characters (found 82). 252
 Error sizes LineLengthLine is longer than 80 characters (found 100).253
Line is longer than 80 characters (found 128).256
 Error sizes LineLengthLine is longer than 80 characters (found 102).255
Line is longer than 80 characters (found 103).257
 Error sizes LineLengthLine is longer than 80 characters (found 114).258
Line is longer than 80 characters (found 84).259
 ErrorcodingHiddenField'contractsDirectory' hides a field.259
 ErrorsizesLineLengthLine is longer than 80 characters (found 105).260
 Error sizes LineLengthLine is longer than 80 characters (found 128).Line is longer than 80 characters (found 95). 261
 Error sizes LineLengthLine is longer than 80 characters (found 124).Line is longer than 80 characters (found 100). 262
 Error sizes LineLengthLine is longer than 80 characters (found 105).Line is longer than 80 characters (found 93). 263
 Error sizes LineLengthLine is longer than 80 characters (found 102).264
 ErrorsizesLineLengthLine is longer than 80 characters (found 102).267
 ErrorsizesLineLengthLine is longer than 80 characters (found 106).270
 ErrorsizesLineLengthLine is longer than 80 characters (found 102).273
 ErrorsizesLineLengthLine is longer than 80 characters (found 88).276
 ErrorsizesLineLengthLine is longer than 80 characters (found 101).277
 ErrorsizesLineLengthLine is longer than 80 characters (found 101).278
 ErrorsizesLineLength Line is longer than 80 characters (found 90).268
284
 ErrorblocksRightCurly'}' at column 3 should be on the same line as the next part of a multi-block statement (one that directly contains multiple blocks: if/else-if/else, do/while or try/catch/finally).285
 ErrorsizesLineLengthLine is longer than 80 characters (found 108).288
 ErrorjavadocJavadocMethodMissing a Javadoc comment.294
 ErrormiscFinalParametersParameter config should be final.294
 ErrormiscFinalParametersParameter contractsDirectory should be final.295
 ErrorcodingHiddenField'contractsDirectory' hides a field.295
 ErrorjavadocJavadocMethodMissing a Javadoc comment.316
 ErrormiscFinalParametersParameter contractsDirectory should be final.316
 ErrorcodingHiddenField'contractsDirectory' hides a field.316
 Error blocks RightCurly '}' at column 3 should be on the same line as the next part of a multi-block statement (one that directly contains multiple blocks: if/else-if/else, do/while or try/catch/finally).269
 ErrorsizesLineLengthLine is longer than 80 characters (found 108).272
 ErrorjavadocJavadocMethodMissing a Javadoc comment.277
 ErrormiscFinalParametersParameter config should be final.277
 ErrormiscFinalParametersParameter contractsDirectory should be final.278
 ErrorcodingHiddenField'contractsDirectory' hides a field.278
 ErrorjavadocJavadocMethodMissing a Javadoc comment.299
 ErrormiscFinalParametersParameter contractsDirectory should be final.299
 ErrorcodingHiddenField'contractsDirectory' hides a field.299
319
 Error design DesignForExtension Class 'GenerateTestsMojo' looks like designed for extension (can be subclassed), but the method 'mappingsToMap' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'GenerateTestsMojo' final or making the method 'mappingsToMap' static/final/abstract/empty, or adding allowed annotation for the method.307
325
 Error javadoc JavadocMethod Missing a Javadoc comment.307
325
 Error sizes LineLength Line is longer than 80 characters (found 94).313
331
 Error design DesignForExtension Class 'GenerateTestsMojo' looks like designed for extension (can be subclassed), but the method 'getExcludedFiles' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'GenerateTestsMojo' final or making the method 'getExcludedFiles' static/final/abstract/empty, or adding allowed annotation for the method.318
336
 Error javadoc JavadocMethod Missing a Javadoc comment.318
336
 Error design DesignForExtension Class 'GenerateTestsMojo' looks like designed for extension (can be subclassed), but the method 'setExcludedFiles' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'GenerateTestsMojo' final or making the method 'setExcludedFiles' static/final/abstract/empty, or adding allowed annotation for the method.322
340
 Error javadoc JavadocMethod Missing a Javadoc comment.322
340
 Error misc FinalParameters Parameter excludedFiles should be final.322
340
 Error coding HiddenField 'excludedFiles' hides a field.322
340
 Error design DesignForExtension Class 'GenerateTestsMojo' looks like designed for extension (can be subclassed), but the method 'getIgnoredFiles' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'GenerateTestsMojo' final or making the method 'getIgnoredFiles' static/final/abstract/empty, or adding allowed annotation for the method.326
344
 Error javadoc JavadocMethod Missing a Javadoc comment.326
344
 Error design DesignForExtension Class 'GenerateTestsMojo' looks like designed for extension (can be subclassed), but the method 'setIgnoredFiles' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'GenerateTestsMojo' final or making the method 'setIgnoredFiles' static/final/abstract/empty, or adding allowed annotation for the method.330
348
 Error javadoc JavadocMethod Missing a Javadoc comment.330
348
 Error misc FinalParameters Parameter ignoredFiles should be final.330
348
 Error coding HiddenField 'ignoredFiles' hides a field.330
348
 Error design DesignForExtension Class 'GenerateTestsMojo' looks like designed for extension (can be subclassed), but the method 'isAssertJsonSize' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'GenerateTestsMojo' final or making the method 'isAssertJsonSize' static/final/abstract/empty, or adding allowed annotation for the method.334
352
 Error javadoc JavadocMethod Missing a Javadoc comment.334
352
 Error design DesignForExtension Class 'GenerateTestsMojo' looks like designed for extension (can be subclassed), but the method 'setAssertJsonSize' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'GenerateTestsMojo' final or making the method 'setAssertJsonSize' static/final/abstract/empty, or adding allowed annotation for the method.338
356
 Error javadoc JavadocMethod Missing a Javadoc comment.338
356
 Error misc FinalParameters Parameter assertJsonSize should be final.338
356
 Error coding HiddenField 'assertJsonSize' hides a field.338
+356

org/springframework/cloud/contract/maven/verifier/ManifestCreator.java

@@ -2443,148 +2457,148 @@ - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + -
sizes LineLength Line is longer than 80 characters (found 94).27
28
 Error whitespace FileTabCharacter File contains tab characters (this is the first instance).27
28
 Error javadoc JavadocMethod Missing a Javadoc comment.27
28
 Error misc FinalParameters Parameter project should be final.27
28
 Error sizes LineLength Line is longer than 80 characters (found 88).29
30
 Error sizes LineLengthLine is longer than 80 characters (found 121).32
 ErrorsizesLineLengthLine is longer than 80 characters (found 102).34
 ErrorsizesLineLengthLine is longer than 80 characters (found 118).35
 ErrorsizesLineLengthLine is longer than 80 characters (found 89).37
 ErrorsizesLineLengthLine is longer than 80 characters (found 128).38
 ErrorjavadocJavadocMethodMissing a Javadoc comment.45
 ErrormiscFinalParametersParameter plugins should be final.45
 ErrorsizesLineLengthLine is longer than 80 characters (found 98).47
 ErrorsizesLineLengthLine is longer than 80 characters (found 81).54
 ErrorjavadocJavadocMethodMissing a Javadoc comment.54
 ErrormiscFinalParametersParameter deps should be final.54
Line is longer than 80 characters (found 108).33
 Error sizes LineLength Line is longer than 80 characters (found 91).56
+34 + + Error +sizes +LineLength +Line is longer than 80 characters (found 86). +37 + + Error +sizes +LineLength +Line is longer than 80 characters (found 89). +41 + + Error +sizes +LineLength +Line is longer than 80 characters (found 87). +42 + + Error +sizes +LineLength +Line is longer than 80 characters (found 108). +43 + + Error +javadoc +JavadocMethod +Missing a Javadoc comment. +49 + + Error +misc +FinalParameters +Parameter plugins should be final. +49 + + Error +sizes +LineLength +Line is longer than 80 characters (found 98). +51 + + Error +sizes +LineLength +Line is longer than 80 characters (found 81). +58 + + Error +javadoc +JavadocMethod +Missing a Javadoc comment. +58 + + Error +misc +FinalParameters +Parameter deps should be final. +58 + + Error +sizes +LineLength +Line is longer than 80 characters (found 91). +60

org/springframework/cloud/contract/maven/verifier/MavenContractsDownloader.java

- + - + - + - + - + - - - - - - - + - + @@ -2596,19 +2610,7 @@ - - - - - - - - - - - - @@ -2617,18 +2619,6 @@ - - - - - - - - - - - - @@ -2638,19 +2628,7 @@ - - - - - - - - - - - - @@ -2659,352 +2637,328 @@ + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + - - + + - - + + - - - - - - - + - - + + - - - - - - - - + + - - - - - - - - - - - - - - - - - - - + - + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - + + + + - - - + + + - - - - + + + + - + - - - - + + + + - - + + @@ -3013,46 +2967,106 @@ + + + + + + - - + + + + + + + + - + - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + -
Severity Category Rule Message Line
 Error javadoc JavadocStyle First sentence should end with a period. 35
 Error whitespace FileTabCharacter File contains tab characters (this is the first instance). 43
 Error javadoc JavadocVariable Missing a Javadoc comment. 43
 Error sizes LineLength Line is longer than 80 characters (found 85).44
 ErrorjavadocJavadocVariableMissing a Javadoc comment.44
45
 Error javadoc JavadocVariable Missing a Javadoc comment.46
45
 Error javadocjavadoc JavadocVariable Missing a Javadoc comment.48
 ErrorjavadocJavadocVariableMissing a Javadoc comment. 49
 ErrorjavadocJavadocVariableMissing a Javadoc comment.50
 Error javadoc51
 ErrorsizesLineLengthLine is longer than 80 characters (found 82).52
 ErrorjavadocJavadocVariableMissing a Javadoc comment.52
 Error javadoc JavadocVariable Missing a Javadoc comment.javadoc JavadocVariable Missing a Javadoc comment.54
 ErrorjavadocJavadocVariableMissing a Javadoc comment. 55
 ErrorjavadocJavadocVariableMissing a Javadoc comment.56
 Error javadoc57
 ErrorsizesLineLengthLine is longer than 80 characters (found 82).59
 Error javadoc JavadocVariable Missing a Javadoc comment.58
59
 ErrorjavadocJavadocVariableMissing a Javadoc comment.61
 ErrorjavadocJavadocVariableMissing a Javadoc comment.63
 ErrorjavadocJavadocVariableMissing a Javadoc comment.65
 ErrorjavadocJavadocVariableMissing a Javadoc comment.67
 ErrorjavadocJavadocVariableMissing a Javadoc comment.69
 ErrorjavadocJavadocVariableMissing a Javadoc comment.71
 Error sizes LineLength Line is longer than 80 characters (found 85).60
73
 Error javadoc JavadocMethod Missing a Javadoc comment.60
73
 Error sizes ParameterNumber More than 7 parameters (found 12).60
73
 Error misc FinalParameters Parameter project should be final.60
73
 Error coding HiddenField 'project' hides a field.60
73
 Error misc FinalParameters Parameter contractDependency should be final.60
73
 Error coding HiddenField 'contractDependency' hides a field.60
73
 Error misc FinalParameters Parameter contractsPath should be final.61
74
 Error coding HiddenField 'contractsPath' hides a field.61
74
 Error misc FinalParameters Parameter contractsRepositoryUrl should be final.61
74
 Error coding HiddenField 'contractsRepositoryUrl' hides a field.61
74
 Error sizes LineLength Line is longer than 80 characters (found 101).62
75
 Error misc FinalParameters Parameter stubsMode should be final.62
75
 Error coding HiddenField 'stubsMode' hides a field.62
75
 Error misc FinalParameters Parameter log should be final.62
75
 Error coding HiddenField 'log' hides a field.62
75
 Error misc FinalParameters Parameter repositoryUsername should be final.62
75
 Error coding HiddenField 'repositoryUsername' hides a field.62
75
 Error misc FinalParameters Parameter repositoryPassword should be final.63
76
 Error coding HiddenField 'repositoryPassword' hides a field.63
76
 Error misc FinalParameters Parameter repositoryProxyHost should be final.63
76
 Error coding HiddenField 'repositoryProxyHost' hides a field.63
76
 Error sizes LineLength Line is longer than 80 characters (found 82).64
77
 Error misc FinalParameters Parameter repositoryProxyPort should be final.64
77
 Error coding HiddenField 'repositoryProxyPort' hides a field.64
77
 Error misc FinalParameters Parameter deleteStubsAfterTest should be final.64
77
 Error coding HiddenField 'deleteStubsAfterTest' hides a field.64
77
 Error misc FinalParameters Parameter contractsProperties should be final.65
78
 Error coding HiddenField 'contractsProperties' hides a field.65
78
 Error sizes LineLength Line is longer than 80 characters (found 89).76
89
 Error sizes LineLengthLine is longer than 80 characters (found 118).81
Line is longer than 80 characters (found 90).94
 Error javadoc JavadocMethod Missing a Javadoc comment.81
94
 Error misc FinalParameters Parameter config should be final.81
94
 Error misc FinalParameters Parameter defaultContractsDir should be final.81
 ErrorsizesLineLengthLine is longer than 80 characters (found 113).82
95
 Error sizes LineLengthLine is longer than 80 characters (found 89).83
Line is longer than 80 characters (found 87).98
 ErrorwhitespaceOperatorWrap'?' should be on a new line.83
 Error coding AvoidInlineConditionals Avoid inline conditionals.83
99
 Error sizes LineLength Line is longer than 80 characters (found 88).86
 ErrorsizesLineLengthLine is longer than 80 characters (found 139).87
 ErrorsizesLineLengthLine is longer than 80 characters (found 107).88
 ErrorsizesLineLengthLine is longer than 80 characters (found 122).91
101
 Error sizes LineLength Line is longer than 80 characters (found 108).92
103
 Error sizes LineLengthLine is longer than 80 characters (found 130).93
Line is longer than 80 characters (found 88).104
 Error sizes LineLengthLine is longer than 80 characters (found 105).96
 ErrorjavadocJavadocMethodMissing a Javadoc comment.100
 ErrorsizesLineLengthLine is longer than 80 characters (found 121).101
 ErrorwhitespaceOperatorWrap'||' should be on a new line.101
 ErrorsizesLineLengthLine is longer than 80 characters (found 81).102
 ErrorjavadocJavadocMethodMissing a Javadoc comment.Line is longer than 80 characters (found 98). 105
 ErrorsizesLineLengthLine is longer than 80 characters (found 84).106
 ErrorsizesLineLengthLine is longer than 80 characters (found 108).107
blocksRightCurly'}' at column 3 should be on the same line as the next part of a multi-block statement (one that directly contains multiple blocks: if/else-if/else, do/while or try/catch/finally).108
 ErrorjavadocJavadocMethodMissing a Javadoc comment.sizesLineLengthLine is longer than 80 characters (found 124). 111
 ErrorjavadocJavadocMethodMissing a Javadoc comment.117
sizesLineLengthLine is longer than 80 characters (found 90).114
 Error sizes LineLengthLine is longer than 80 characters (found 81).Line is longer than 80 characters (found 97). 118
 ErrorsizesLineLengthLine is longer than 80 characters (found 81).119
javadocJavadocMethodMissing a Javadoc comment.123
 Error sizes LineLengthLine is longer than 80 characters (found 84).123
Line is longer than 80 characters (found 95).125
 Error sizes126
 ErrorjavadocJavadocMethodMissing a Javadoc comment.129
 Error sizes LineLengthLine is longer than 80 characters (found 94).129
Line is longer than 80 characters (found 84).130
 ErrorsizesLineLengthLine is longer than 80 characters (found 89).132
 Error javadoc JavadocMethod Missing a Javadoc comment.134
135
 Error sizes LineLengthLine is longer than 80 characters (found 92).Line is longer than 80 characters (found 81). 137
 ErrorwhitespaceOperatorWrap'?' should be on a new line.137
javadocJavadocMethodMissing a Javadoc comment.140
 ErrorsizesLineLengthLine is longer than 80 characters (found 81).141
 ErrorsizesLineLengthLine is longer than 80 characters (found 81).142
 ErrorsizesLineLengthLine is longer than 80 characters (found 100).143
 ErrorsizesLineLengthLine is longer than 80 characters (found 84).145
 ErrorsizesLineLengthLine is longer than 80 characters (found 84).148
 ErrorsizesLineLengthLine is longer than 80 characters (found 94).151
 ErrorjavadocJavadocMethodMissing a Javadoc comment.156
 ErrorsizesLineLengthLine is longer than 80 characters (found 90).159
 ErrorsizesLineLengthLine is longer than 80 characters (found 88).160
 Error coding AvoidInlineConditionals Avoid inline conditionals.137
 ErrorsizesLineLengthLine is longer than 80 characters (found 86).138
160
 Error sizes LineLength Line is longer than 80 characters (found 87).140
+162

org/springframework/cloud/contract/maven/verifier/PushStubsToScmMojo.java

@@ -3064,178 +3078,202 @@ - - - + + + - - - + + + - + + + + + + + + + + + + + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - + + + + + + + + + + + + + - - + + + + + + + + + + + + + + - - + + - + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -
Line
 ErrorwhitespaceFileTabCharacterFile contains tab characters (this is the first instance).sizesLineLengthLine is longer than 80 characters (found 97). 40
 ErrorjavadocJavadocVariableMissing a Javadoc comment.whitespaceFileTabCharacterFile contains tab characters (this is the first instance). 40
 Error javadoc JavadocVariable Missing a Javadoc comment.44
40
 ErrorsizesLineLengthLine is longer than 80 characters (found 98).43
 ErrorjavadocJavadocVariableMissing a Javadoc comment.43
 Error javadoc JavadocStyle First sentence should end with a period.48
46
 Error sizes LineLength Line is longer than 80 characters (found 92).51
49
 Error javadoc JavadocStyle First sentence should end with a period.54
52
 Error sizes LineLength Line is longer than 80 characters (found 113).57
55
 Error javadoc JavadocVariable Missing a Javadoc comment.60
58
 Error sizes LineLengthLine is longer than 80 characters (found 113).77
 ErrorjavadocJavadocStyleFirst sentence should end with a period.83
 ErrorjavadocJavadocStyleFirst sentence should end with a period.90
 ErrorjavadocJavadocStyleFirst sentence should end with a period.97
 ErrorsizesLineLengthLine is longer than 80 characters (found 133).98
 ErrordesignDesignForExtensionClass 'PushStubsToScmMojo' looks like designed for extension (can be subclassed), but the method 'execute' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'PushStubsToScmMojo' final or making the method 'execute' static/final/abstract/empty, or adding allowed annotation for the method.103
 ErrorjavadocJavadocMethodMissing a Javadoc comment.103
 ErrorsizesLineLengthLine is longer than 80 characters (found 129).106
 ErrorsizesLineLengthLine is longer than 80 characters (found 149).107
 ErrorwhitespaceOperatorWrap'||' should be on a new line.110
 ErrorsizesLineLengthLine is longer than 80 characters (found 108).111
 ErrorsizesLineLengthLine is longer than 80 characters (found 160).112
 ErrorsizesLineLengthLine is longer than 80 characters (found 134).115
Line is longer than 80 characters (found 84).74
 Error sizes LineLength Line is longer than 80 characters (found 88).116
75
 ErrorjavadocJavadocStyleFirst sentence should end with a period.81
 ErrorjavadocJavadocStyleFirst sentence should end with a period.87
 Error sizes LineLengthLine is longer than 80 characters (found 125).117
Line is longer than 80 characters (found 94).88
 ErrorjavadocJavadocStyleFirst sentence should end with a period.94
 ErrorsizesLineLengthLine is longer than 80 characters (found 86).96
 Error design DesignForExtensionClass 'PushStubsToScmMojo' looks like designed for extension (can be subclassed), but the method 'buildOptions' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'PushStubsToScmMojo' final or making the method 'buildOptions' static/final/abstract/empty, or adding allowed annotation for the method.120
Class 'PushStubsToScmMojo' looks like designed for extension (can be subclassed), but the method 'execute' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'PushStubsToScmMojo' final or making the method 'execute' static/final/abstract/empty, or adding allowed annotation for the method.101
 Error javadoc JavadocMethod Missing a Javadoc comment.120
101
 Error sizes LineLengthLine is longer than 80 characters (found 81).121
Line is longer than 80 characters (found 129).104
 Error sizes LineLengthLine is longer than 80 characters (found 81).122
Line is longer than 80 characters (found 119).106
 Error sizes LineLengthLine is longer than 80 characters (found 84).Line is longer than 80 characters (found 97).110
 ErrorsizesLineLengthLine is longer than 80 characters (found 83).111
 ErrorsizesLineLengthLine is longer than 80 characters (found 162).113
 ErrorsizesLineLengthLine is longer than 80 characters (found 97).117
 ErrorsizesLineLengthLine is longer than 80 characters (found 88).118
 ErrorsizesLineLengthLine is longer than 80 characters (found 93).119
 ErrordesignDesignForExtensionClass 'PushStubsToScmMojo' looks like designed for extension (can be subclassed), but the method 'buildOptions' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'PushStubsToScmMojo' final or making the method 'buildOptions' static/final/abstract/empty, or adding allowed annotation for the method. 123
 ErrorjavadocJavadocMethodMissing a Javadoc comment.123
 ErrorsizesLineLengthLine is longer than 80 characters (found 81).124
 ErrorsizesLineLengthLine is longer than 80 characters (found 81).125
 Error sizes LineLength Line is longer than 80 characters (found 84).127
+126 + + Error +sizes +LineLength +Line is longer than 80 characters (found 84). +130

org/springframework/cloud/contract/maven/verifier/RunMojo.java

@@ -3429,113 +3467,137 @@ - - + + - + - - + + - - + + - + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - -
 Error sizes LineLengthLine is longer than 80 characters (found 119).118
Line is longer than 80 characters (found 107).119
 Error sizes LineLength Line is longer than 80 characters (found 88).122
124
 Error sizes LineLengthLine is longer than 80 characters (found 85).126
Line is longer than 80 characters (found 94).128
 Error sizes LineLengthLine is longer than 80 characters (found 125).128
Line is longer than 80 characters (found 97).130
 Error sizes LineLength Line is longer than 80 characters (found 97).129
131
 ErrorsizesLineLengthLine is longer than 80 characters (found 83).133
blocksRightCurly'}' at column 3 should be on the same line as the next part of a multi-block statement (one that directly contains multiple blocks: if/else-if/else, do/while or try/catch/finally).132
 Error sizes LineLengthLine is longer than 80 characters (found 95).135
 ErrorsizesLineLengthLine is longer than 80 characters (found 103).142
 ErrorjavadocJavadocMethodMissing a Javadoc comment.147
 ErrorjavadocJavadocMethodMissing a Javadoc comment.155
 ErrorjavadocJavadocMethodMissing a Javadoc comment.166
-
-

org/springframework/cloud/contract/maven/verifier/stubrunner/AetherStubDownloaderFactory.java

- - - - - - - - - - - - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
SeverityCategoryRuleMessageLine
 ErrorjavadocJavadocTypeMissing a Javadoc comment.34
Line is longer than 80 characters (found 88).134
 Error sizes LineLength Line is longer than 80 characters (found 92).37
135
 ErrorsizesLineLengthLine is longer than 80 characters (found 95).136
 ErrorblocksRightCurly'}' at column 4 should be on the same line as the next part of a multi-block statement (one that directly contains multiple blocks: if/else-if/else, do/while or try/catch/finally).142
 ErrorsizesLineLengthLine is longer than 80 characters (found 103).144
 ErrorjavadocJavadocMethodMissing a Javadoc comment.149
 ErrorblocksRightCurly'}' at column 3 should be on the same line as the next part of a multi-block statement (one that directly contains multiple blocks: if/else-if/else, do/while or try/catch/finally).152
 ErrorjavadocJavadocMethodMissing a Javadoc comment.158
 ErrorblocksRightCurly'}' at column 3 should be on the same line as the next part of a multi-block statement (one that directly contains multiple blocks: if/else-if/else, do/while or try/catch/finally).165
 ErrorjavadocJavadocMethodMissing a Javadoc comment.170
+
+

org/springframework/cloud/contract/maven/verifier/stubrunner/AetherStubDownloaderFactory.java

+ + + + + + + + + + + + + + + + + + + + + - - + + - - + + - - - - - - - + @@ -3545,99 +3607,111 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - + -
SeverityCategoryRuleMessageLine
 ErrorjavadocJavadocTypeMissing a Javadoc comment.34
 ErrorsizesLineLengthLine is longer than 80 characters (found 92).38
 Error whitespace FileTabCharacter File contains tab characters (this is the first instance).37
38
 Error javadoc JavadocVariable Missing a Javadoc comment.37
38
 Error naming ConstantName Name 'log' must match pattern '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.37
 ErrorjavadocJavadocVariableMissing a Javadoc comment.39
38
 Error javadoc
 Error javadocJavadocMethodJavadocVariable Missing a Javadoc comment. 42
 ErrormiscFinalParametersParameter repoSystem should be final.43
 ErrorcodingHiddenField'repoSystem' hides a field.43
 ErrormiscFinalParametersParameter project should be final.44
 ErrorcodingHiddenField'project' hides a field.44
 ErrorsizesLineLengthLine is longer than 80 characters (found 87).49
 ErrordesignDesignForExtensionClass 'AetherStubDownloaderFactory' looks like designed for extension (can be subclassed), but the method 'build' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'AetherStubDownloaderFactory' final or making the method 'build' static/final/abstract/empty, or adding allowed annotation for the method.49
 Error javadoc JavadocMethod Missing a Javadoc comment.49
44
 ErrormiscFinalParametersParameter repoSystem should be final.45
 ErrorcodingHiddenField'repoSystem' hides a field.45
 ErrormiscFinalParametersParameter project should be final.46
 ErrorcodingHiddenField'project' hides a field.46
 Error sizes LineLengthLine is longer than 80 characters (found 100).Line is longer than 80 characters (found 87). 51
 ErrordesignDesignForExtensionClass 'AetherStubDownloaderFactory' looks like designed for extension (can be subclassed), but the method 'build' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'AetherStubDownloaderFactory' final or making the method 'build' static/final/abstract/empty, or adding allowed annotation for the method.51
 ErrorjavadocJavadocMethodMissing a Javadoc comment.51
 ErrorsizesLineLengthLine is longer than 80 characters (found 90).54
 Error misc FinalParameters Parameter stubRunnerOptions should be final.51
 ErrorsizesLineLengthLine is longer than 80 characters (found 113).52
 ErrorsizesLineLengthLine is longer than 80 characters (found 108).53
 ErrorsizesLineLengthLine is longer than 80 characters (found 134). 54
 Error sizes LineLengthLine is longer than 80 characters (found 97).Line is longer than 80 characters (found 120).56
 ErrorsizesLineLengthLine is longer than 80 characters (found 92). 58
 ErrorsizesLineLengthLine is longer than 80 characters (found 88).59
 ErrorsizesLineLengthLine is longer than 80 characters (found 96).60
 ErrorsizesLineLengthLine is longer than 80 characters (found 97).65
 Error misc FinalParameters Parameter location should be final.58
65
 Error misc FinalParameters Parameter resourceLoader should be final.58
+65

org/springframework/cloud/contract/maven/verifier/stubrunner/LocalStubRunner.java

@@ -3664,49 +3738,49 @@ - + - + - + - + - + - + - + -
whitespace FileTabCharacter File contains tab characters (this is the first instance).28
29
 Error javadoc JavadocVariable Missing a Javadoc comment.28
29
 Error naming ConstantName Name 'log' must match pattern '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.28
29
 Error sizes LineLength Line is longer than 80 characters (found 85).30
31
 Error design DesignForExtension Class 'LocalStubRunner' looks like designed for extension (can be subclassed), but the method 'run' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'LocalStubRunner' final or making the method 'run' static/final/abstract/empty, or adding allowed annotation for the method.30
31
 Error javadoc JavadocMethod Missing a Javadoc comment.30
31
 Error misc FinalParameters Parameter options should be final.30
31
 Error sizes LineLength Line is longer than 80 characters (found 85).31
+32

org/springframework/cloud/contract/maven/verifier/stubrunner/RemoteStubRunner.java

@@ -3727,121 +3801,109 @@ - + - + - + - + - + - + - + - + - + - - - - - - - - + + - - + + - - + + - - - - - - - + - + - + - + - + - -
sizes LineLength Line is longer than 80 characters (found 81).32
33
 Error whitespace FileTabCharacter File contains tab characters (this is the first instance).32
33
 Error javadoc JavadocVariable Missing a Javadoc comment.32
33
 Error naming ConstantName Name 'log' must match pattern '^[A-Z][A-Z0-9]*(_[A-Z0-9]+)*$'.32
33
 Error javadoc JavadocVariable Missing a Javadoc comment.34
35
 Error javadoc JavadocMethod Missing a Javadoc comment.36
37
 Error sizes LineLength Line is longer than 80 characters (found 90).37
38
 Error misc FinalParameters Parameter aetherStubDownloaderFactory should be final.37
38
 Error coding HiddenField 'aetherStubDownloaderFactory' hides a field.37
38
 ErrorsizesLineLengthLine is longer than 80 characters (found 112).41
 Error design DesignForExtension Class 'RemoteStubRunner' looks like designed for extension (can be subclassed), but the method 'run' does not have javadoc that explains how to do that safely. If class is not designed for extension consider making the class 'RemoteStubRunner' final or making the method 'run' static/final/abstract/empty, or adding allowed annotation for the method.41
42
 Error javadoc JavadocMethod Missing a Javadoc comment.41
42
 Error misc FinalParameters Parameter options should be final.41
42
 Error misc FinalParameters Parameter repositorySystemSession should be final.41
 ErrorsizesLineLengthLine is longer than 80 characters (found 127).42
43
 Error sizes LineLength Line is longer than 80 characters (found 88).45
48
 Error sizes LineLength Line is longer than 80 characters (found 88).47
50
 Error sizes LineLength Line is longer than 80 characters (found 82).49
52
 Error blocks RightCurly '}' at column 3 should be on the same line as the next part of a multi-block statement (one that directly contains multiple blocks: if/else-if/else, do/while or try/catch/finally).52
55
 Error sizes LineLengthLine is longer than 80 characters (found 112).54
+Line is longer than 80 characters (found 93). +57 diff --git a/spring-cloud-contract-maven-plugin/checkstyle.rss b/spring-cloud-contract-maven-plugin/checkstyle.rss index 3a5da98b7a..e82c96df90 100644 --- a/spring-cloud-contract-maven-plugin/checkstyle.rss +++ b/spring-cloud-contract-maven-plugin/checkstyle.rss @@ -26,7 +26,7 @@ under the License. ©2016 - 2018 Spring File: 12, - Errors: 545, + Errors: 557, Warnings: 0, Infos: 0 @@ -55,7 +55,7 @@ under the License. 0 - 110 + 117 @@ -69,7 +69,7 @@ under the License. 0 - 84 + 83 @@ -83,7 +83,7 @@ under the License. 0 - 37 + 40 @@ -97,7 +97,7 @@ under the License. 0 - 37 + 34 @@ -111,7 +111,7 @@ under the License. 0 - 29 + 33 @@ -125,7 +125,7 @@ under the License. 0 - 23 + 24 @@ -139,7 +139,7 @@ under the License. 0 - 41 + 46 @@ -153,7 +153,7 @@ under the License. 0 - 51 + 50 @@ -167,7 +167,7 @@ under the License. 0 - 21 + 19 @@ -195,7 +195,7 @@ under the License. 0 - 19 + 20 @@ -209,7 +209,7 @@ under the License. 0 - 83 + 81 diff --git a/spring-cloud-contract.xml b/spring-cloud-contract.xml index 3964d02c60..cddc394444 100644 --- a/spring-cloud-contract.xml +++ b/spring-cloud-contract.xml @@ -4479,19 +4479,20 @@ import java.util.Map; import org.springframework.cloud.contract.spec.Contract; public interface StubFinder extends StubTrigger { + /** - * For the given groupId and artifactId tries to find the matching - * URL of the running stub. - * - * @param groupId - might be null. In that case a search only via artifactId takes place + * For the given groupId and artifactId tries to find the matching URL of the running + * stub. + * @param groupId - might be null. In that case a search only via artifactId takes + * place * @return URL of a running stub or throws exception if not found */ URL findStubUrl(String groupId, String artifactId) throws StubNotFoundException; /** - * For the given Ivy notation {@code [groupId]:artifactId:[version]:[classifier]} tries to - * find the matching URL of the running stub. You can also pass only {@code artifactId}. - * + * For the given Ivy notation {@code [groupId]:artifactId:[version]:[classifier]} + * tries to find the matching URL of the running stub. You can also pass only + * {@code artifactId}. * @param ivyNotation - Ivy representation of the Maven artifact * @return URL of a running stub or throws exception if not found */ @@ -4506,6 +4507,7 @@ public interface StubFinder extends StubTrigger { * Returns the list of Contracts */ Map<StubConfiguration, Collection<Contract>> getContracts(); + } Example of usage in Spock tests: @ClassRule @Shared StubRunnerRule rule = new StubRunnerRule() @@ -5300,10 +5302,10 @@ import java.util.Map; public interface StubTrigger { /** - * Triggers an event by a given label for a given {@code groupid:artifactid} notation. You can use only {@code artifactId} too. + * Triggers an event by a given label for a given {@code groupid:artifactid} notation. + * You can use only {@code artifactId} too. * * Feature related to messaging. - * * @return true - if managed to run a trigger */ boolean trigger(String ivyNotation, String labelName); @@ -5312,7 +5314,6 @@ public interface StubTrigger { * Triggers an event by a given label. * * Feature related to messaging. - * * @return true - if managed to run a trigger */ boolean trigger(String labelName); @@ -5321,7 +5322,6 @@ public interface StubTrigger { * Triggers all possible events. * * Feature related to messaging. - * * @return true - if managed to run a trigger */ boolean trigger(); @@ -5332,6 +5332,7 @@ public interface StubTrigger { * Feature related to messaging. */ Map<String, Collection<String>> labels(); + } For convenience, the StubFinder interface extends StubTrigger, so you only need one or the other in your tests. @@ -5746,13 +5747,15 @@ follows: integration looks for bindings related to this exchange. @Bean public Binding binding() { - return BindingBuilder.bind(new Queue("test.queue")).to(new DirectExchange("contract-test.exchange")).with("#"); + return BindingBuilder.bind(new Queue("test.queue")) + .to(new DirectExchange("contract-test.exchange")).with("#"); } The binding definition binds the queue test.queue. As a result, the following listener definition is matched and invoked with the contract message. @Bean -public SimpleMessageListenerContainer simpleMessageListenerContainer(ConnectionFactory connectionFactory, - MessageListenerAdapter listenerAdapter) { +public SimpleMessageListenerContainer simpleMessageListenerContainer( + ConnectionFactory connectionFactory, + MessageListenerAdapter listenerAdapter) { SimpleMessageListenerContainer container = new SimpleMessageListenerContainer(); container.setConnectionFactory(connectionFactory); container.setQueueNames("test.queue"); @@ -5761,9 +5764,7 @@ public SimpleMessageListenerContainer simpleMessageListenerContainer(ConnectionF return container; } Also, the following annotated listener matches and is invoked: -@RabbitListener(bindings = @QueueBinding( - value = @Queue(value = "test.queue"), - exchange = @Exchange(value = "contract-test.exchange", ignoreDeclarationExceptions = "true"))) +@RabbitListener(bindings = @QueueBinding(value = @Queue(value = "test.queue"), exchange = @Exchange(value = "contract-test.exchange", ignoreDeclarationExceptions = "true"))) public void handlePerson(Person person) { this.person = person; } @@ -9480,21 +9481,23 @@ your test. The following code shows an example: @SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) @AutoConfigureWireMock(port = 0) public class WiremockForDocsTests { + // A service that calls out over HTTP - @Autowired private Service service; + @Autowired + private Service service; // Using the WireMock APIs in the normal way: @Test public void contextLoads() throws Exception { // Stubbing WireMock - stubFor(get(urlEqualTo("/resource")) - .willReturn(aResponse().withHeader("Content-Type", "text/plain").withBody("Hello World!"))); + stubFor(get(urlEqualTo("/resource")).willReturn(aResponse() + .withHeader("Content-Type", "text/plain").withBody("Hello World!"))); // We're asserting if WireMock responded properly assertThat(this.service.go()).isEqualTo("Hello World!"); } } -//end::wiremock_test2[] +// end::wiremock_test2[] To start the stub server on a different port use (for example), @AutoConfigureWireMock(port=9999). For a random port, use a value of 0. The stub server port can be bound in the test application context with the "wiremock.server.port" @@ -9560,6 +9563,7 @@ public class WiremockForDocsClassRuleTests { @ClassRule public static WireMockClassRule wiremock = new WireMockClassRule( WireMockSpring.options().dynamicPort()); + // A service that calls out over HTTP to localhost:${wiremock.port} @Autowired private Service service; @@ -9568,14 +9572,14 @@ public class WiremockForDocsClassRuleTests { @Test public void contextLoads() throws Exception { // Stubbing WireMock - wiremock.stubFor(get(urlEqualTo("/resource")) - .willReturn(aResponse().withHeader("Content-Type", "text/plain").withBody("Hello World!"))); + wiremock.stubFor(get(urlEqualTo("/resource")).willReturn(aResponse() + .withHeader("Content-Type", "text/plain").withBody("Hello World!"))); // We're asserting if WireMock responded properly assertThat(this.service.go()).isEqualTo("Hello World!"); } } -//end::wiremock_test2[] +// end::wiremock_test2[] The @ClassRule means that the server shuts down after all the methods in this class have been run. @@ -9640,6 +9644,7 @@ public class WiremockForDocsMockServerApplicationTests { assertThat(this.service.go()).isEqualTo("Hello World"); server.verify(); } + } The baseUrl value is prepended to all mock calls, and the stubs() method takes a stub path resource pattern as an argument. In the preceding example, the stub defined at @@ -9659,9 +9664,11 @@ Wiremock dependencies and exclude the Spring Boot container (if there is one).You can register a bean of org.springframework.cloud.contract.wiremock.WireMockConfigurationCustomizer type in order to customize the WireMock configuration (e.g. add custom transformers). Example: - @Bean WireMockConfigurationCustomizer optionsCustomizer() { + @Bean + WireMockConfigurationCustomizer optionsCustomizer() { return new WireMockConfigurationCustomizer() { - @Override public void customize(WireMockConfiguration options) { + @Override + public void customize(WireMockConfiguration options) { // perform your customization here } }; @@ -9816,16 +9823,14 @@ configuration) so that the plugin finds them. is there because it makes sense to generate both the contracts and the stubs. Consider the following test: - this.mockMvc.perform(post("/foo") - .accept(MediaType.APPLICATION_PDF) - .accept(MediaType.APPLICATION_JSON) - .contentType(MediaType.APPLICATION_JSON) - .content("{\"foo\": 23, \"bar\" : \"baz\" }")) - .andExpect(status().isOk()) - .andExpect(content().string("bar")) + this.mockMvc + .perform(post("/foo").accept(MediaType.APPLICATION_PDF) + .accept(MediaType.APPLICATION_JSON) + .contentType(MediaType.APPLICATION_JSON) + .content("{\"foo\": 23, \"bar\" : \"baz\" }")) + .andExpect(status().isOk()).andExpect(content().string("bar")) // first WireMock - .andDo(WireMockRestDocs.verify() - .jsonPath("$[?(@.foo >= 20)]") + .andDo(WireMockRestDocs.verify().jsonPath("$[?(@.foo >= 20)]") .jsonPath("$[?(@.bar in ['baz','bazz','bazzz'])]") .contentType(MediaType.valueOf("application/json")) .stub("shouldGrantABeerIfOldEnough"))