1
1
/*
2
- * Copyright 2002-2015 the original author or authors.
2
+ * Copyright 2002-2018 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
36
36
import org .springframework .mock .web .MockHttpServletRequest ;
37
37
import org .springframework .test .annotation .DirtiesContext ;
38
38
import org .springframework .test .context .ContextConfiguration ;
39
- import org .springframework .test .context .junit4 .SpringJUnit4ClassRunner ;
39
+ import org .springframework .test .context .junit4 .SpringRunner ;
40
40
import org .springframework .test .context .web .WebAppConfiguration ;
41
41
import org .springframework .test .web .servlet .MockMvc ;
42
42
import org .springframework .web .bind .annotation .RequestMapping ;
43
43
import org .springframework .web .bind .annotation .RestController ;
44
44
import org .springframework .web .context .WebApplicationContext ;
45
45
import org .springframework .web .context .annotation .RequestScope ;
46
+ import org .springframework .web .context .annotation .SessionScope ;
46
47
import org .springframework .web .context .request .RequestAttributes ;
47
48
import org .springframework .web .context .request .RequestContextHolder ;
48
49
import org .springframework .web .context .request .ServletRequestAttributes ;
71
72
* @author Sam Brannen
72
73
* @see CustomRequestAttributesRequestContextHolderTests
73
74
*/
74
- @ RunWith (SpringJUnit4ClassRunner .class )
75
+ @ RunWith (SpringRunner .class )
75
76
@ WebAppConfiguration
76
77
@ ContextConfiguration
77
78
@ DirtiesContext
@@ -163,7 +164,6 @@ public RequestScopedController requestScopedController() {
163
164
164
165
@ Bean
165
166
@ RequestScope
166
- @ Scope (scopeName = "request" , proxyMode = ScopedProxyMode .TARGET_CLASS )
167
167
public RequestScopedService requestScopedService () {
168
168
return new RequestScopedService ();
169
169
}
@@ -174,7 +174,7 @@ public ControllerWithRequestScopedService controllerWithRequestScopedService() {
174
174
}
175
175
176
176
@ Bean
177
- @ Scope ( scopeName = "session" , proxyMode = ScopedProxyMode . TARGET_CLASS )
177
+ @ SessionScope
178
178
public SessionScopedService sessionScopedService () {
179
179
return new SessionScopedService ();
180
180
}
0 commit comments