Skip to content

Commit 9973694

Browse files
committed
Polishing
1 parent 153a23d commit 9973694

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

spring-websocket/src/test/java/org/springframework/web/socket/config/HandlersBeanDefinitionParserTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
*/
7575
public class HandlersBeanDefinitionParserTests {
7676

77-
private GenericWebApplicationContext appContext = new GenericWebApplicationContext();
77+
private final GenericWebApplicationContext appContext = new GenericWebApplicationContext();
7878

7979

8080
@Test

spring-websocket/src/test/java/org/springframework/web/socket/config/MessageBrokerBeanDefinitionParserTests.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import java.util.Map;
2525

2626
import org.hamcrest.Matchers;
27-
import org.junit.Before;
2827
import org.junit.Test;
2928

3029
import org.springframework.beans.DirectFieldAccessor;
@@ -99,13 +98,7 @@
9998
*/
10099
public class MessageBrokerBeanDefinitionParserTests {
101100

102-
private GenericWebApplicationContext appContext;
103-
104-
105-
@Before
106-
public void setup() {
107-
this.appContext = new GenericWebApplicationContext();
108-
}
101+
private final GenericWebApplicationContext appContext = new GenericWebApplicationContext();
109102

110103

111104
@Test
@@ -231,7 +224,7 @@ public void simpleBroker() throws Exception {
231224
assertNotNull(this.appContext.getBean("webSocketScopeConfigurer", CustomScopeConfigurer.class));
232225

233226
DirectFieldAccessor subscriptionRegistryAccessor = new DirectFieldAccessor(brokerMessageHandler.getSubscriptionRegistry());
234-
String pathSeparator = (String)new DirectFieldAccessor(subscriptionRegistryAccessor.getPropertyValue("pathMatcher")).getPropertyValue("pathSeparator");
227+
String pathSeparator = (String) new DirectFieldAccessor(subscriptionRegistryAccessor.getPropertyValue("pathMatcher")).getPropertyValue("pathSeparator");
235228
assertEquals(".", pathSeparator);
236229
}
237230

@@ -355,7 +348,7 @@ public void annotationMethodMessageHandler() {
355348
assertEquals(MimeTypeUtils.APPLICATION_JSON, ((DefaultContentTypeResolver) resolver).getDefaultMimeType());
356349

357350
DirectFieldAccessor handlerAccessor = new DirectFieldAccessor(annotationMethodMessageHandler);
358-
String pathSeparator = (String)new DirectFieldAccessor(handlerAccessor.getPropertyValue("pathMatcher")).getPropertyValue("pathSeparator");
351+
String pathSeparator = (String) new DirectFieldAccessor(handlerAccessor.getPropertyValue("pathMatcher")).getPropertyValue("pathSeparator");
359352
assertEquals(".", pathSeparator);
360353
}
361354

0 commit comments

Comments
 (0)