Skip to content

Commit 1b54d21

Browse files
committed
Polishing
1 parent a87b319 commit 1b54d21

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/RequestContextHolderTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,13 +36,14 @@
3636
import org.springframework.mock.web.MockHttpServletRequest;
3737
import org.springframework.test.annotation.DirtiesContext;
3838
import org.springframework.test.context.ContextConfiguration;
39-
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
39+
import org.springframework.test.context.junit4.SpringRunner;
4040
import org.springframework.test.context.web.WebAppConfiguration;
4141
import org.springframework.test.web.servlet.MockMvc;
4242
import org.springframework.web.bind.annotation.RequestMapping;
4343
import org.springframework.web.bind.annotation.RestController;
4444
import org.springframework.web.context.WebApplicationContext;
4545
import org.springframework.web.context.annotation.RequestScope;
46+
import org.springframework.web.context.annotation.SessionScope;
4647
import org.springframework.web.context.request.RequestAttributes;
4748
import org.springframework.web.context.request.RequestContextHolder;
4849
import org.springframework.web.context.request.ServletRequestAttributes;
@@ -71,7 +72,7 @@
7172
* @author Sam Brannen
7273
* @see CustomRequestAttributesRequestContextHolderTests
7374
*/
74-
@RunWith(SpringJUnit4ClassRunner.class)
75+
@RunWith(SpringRunner.class)
7576
@WebAppConfiguration
7677
@ContextConfiguration
7778
@DirtiesContext
@@ -163,7 +164,6 @@ public RequestScopedController requestScopedController() {
163164

164165
@Bean
165166
@RequestScope
166-
@Scope(scopeName = "request", proxyMode = ScopedProxyMode.TARGET_CLASS)
167167
public RequestScopedService requestScopedService() {
168168
return new RequestScopedService();
169169
}
@@ -174,7 +174,7 @@ public ControllerWithRequestScopedService controllerWithRequestScopedService() {
174174
}
175175

176176
@Bean
177-
@Scope(scopeName = "session", proxyMode = ScopedProxyMode.TARGET_CLASS)
177+
@SessionScope
178178
public SessionScopedService sessionScopedService() {
179179
return new SessionScopedService();
180180
}

0 commit comments

Comments
 (0)