Commit a695e062 authored by Stephane Nicoll's avatar Stephane Nicoll

Merge pull request #17864 from succezlijunyi

* pr/17864:
  Delete redundant variables

Closes gh-17864
parents ba4c5be2 64344214
...@@ -198,8 +198,7 @@ class ValidationBindHandlerTests { ...@@ -198,8 +198,7 @@ class ValidationBindHandlerTests {
action.run(); action.run();
} }
catch (BindException ex) { catch (BindException ex) {
BindValidationException cause = (BindValidationException) ex.getCause(); return (BindValidationException) ex.getCause();
return cause;
} }
throw new IllegalStateException("Did not throw"); throw new IllegalStateException("Did not throw");
} }
......
...@@ -176,9 +176,8 @@ class JsonObjectDeserializerTests { ...@@ -176,9 +176,8 @@ class JsonObjectDeserializerTests {
@Test @Test
void getRequiredNodeWhenNodeIsFoundShouldReturnNode() { void getRequiredNodeWhenNodeIsFoundShouldReturnNode() {
JsonNode node = mock(JsonNode.class); JsonNode node = mock(JsonNode.class);
JsonNode tree = node; given(node.get("test")).willReturn(node);
given(tree.get("test")).willReturn(node); assertThat(this.testDeserializer.testGetRequiredNode(node, "test")).isEqualTo(node);
assertThat(this.testDeserializer.testGetRequiredNode(tree, "test")).isEqualTo(node);
} }
static class TestJsonObjectDeserializer<T> extends JsonObjectDeserializer<T> { static class TestJsonObjectDeserializer<T> extends JsonObjectDeserializer<T> {
......
...@@ -187,9 +187,8 @@ class ServletWebServerMvcIntegrationTests { ...@@ -187,9 +187,8 @@ class ServletWebServerMvcIntegrationTests {
@Bean @Bean
DispatcherServlet dispatcherServlet() { DispatcherServlet dispatcherServlet() {
DispatcherServlet dispatcherServlet = new DispatcherServlet();
// Can configure dispatcher servlet here as would usually do via init-params // Can configure dispatcher servlet here as would usually do via init-params
return dispatcherServlet; return new DispatcherServlet();
} }
@Bean @Bean
......
...@@ -1084,8 +1084,7 @@ public abstract class AbstractServletWebServerFactoryTests { ...@@ -1084,8 +1084,7 @@ public abstract class AbstractServletWebServerFactoryTests {
String[] parts = header.split(":"); String[] parts = header.split(":");
request.getHeaders().add(parts[0], parts[1]); request.getHeaders().add(parts[0], parts[1]);
} }
ClientHttpResponse response = request.execute(); return request.execute();
return response;
} }
protected void assertForwardHeaderIsUsed(ServletWebServerFactory factory) throws IOException, URISyntaxException { protected void assertForwardHeaderIsUsed(ServletWebServerFactory factory) throws IOException, URISyntaxException {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment