diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandlerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandlerTests.java index e661889734..2c0c17c846 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandlerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/properties/bind/validation/ValidationBindHandlerTests.java @@ -198,8 +198,7 @@ class ValidationBindHandlerTests { action.run(); } catch (BindException ex) { - BindValidationException cause = (BindValidationException) ex.getCause(); - return cause; + return (BindValidationException) ex.getCause(); } throw new IllegalStateException("Did not throw"); } diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/JsonObjectDeserializerTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/JsonObjectDeserializerTests.java index 2491d148c1..9eac6ae63c 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/JsonObjectDeserializerTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/jackson/JsonObjectDeserializerTests.java @@ -176,9 +176,8 @@ class JsonObjectDeserializerTests { @Test void getRequiredNodeWhenNodeIsFoundShouldReturnNode() { JsonNode node = mock(JsonNode.class); - JsonNode tree = node; - given(tree.get("test")).willReturn(node); - assertThat(this.testDeserializer.testGetRequiredNode(tree, "test")).isEqualTo(node); + given(node.get("test")).willReturn(node); + assertThat(this.testDeserializer.testGetRequiredNode(node, "test")).isEqualTo(node); } static class TestJsonObjectDeserializer extends JsonObjectDeserializer { diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerMvcIntegrationTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerMvcIntegrationTests.java index 04e0cf789a..5432205708 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerMvcIntegrationTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/context/ServletWebServerMvcIntegrationTests.java @@ -187,9 +187,8 @@ class ServletWebServerMvcIntegrationTests { @Bean DispatcherServlet dispatcherServlet() { - DispatcherServlet dispatcherServlet = new DispatcherServlet(); // Can configure dispatcher servlet here as would usually do via init-params - return dispatcherServlet; + return new DispatcherServlet(); } @Bean diff --git a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java index cabc48689d..1d24a44e1a 100644 --- a/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java +++ b/spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/servlet/server/AbstractServletWebServerFactoryTests.java @@ -1084,8 +1084,7 @@ public abstract class AbstractServletWebServerFactoryTests { String[] parts = header.split(":"); request.getHeaders().add(parts[0], parts[1]); } - ClientHttpResponse response = request.execute(); - return response; + return request.execute(); } protected void assertForwardHeaderIsUsed(ServletWebServerFactory factory) throws IOException, URISyntaxException {