From 1b54d2119d26672139031ea9ffce1c9a28e6f2ea Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Wed, 15 Aug 2018 12:27:45 +0200 Subject: [PATCH] Polishing --- .../servlet/samples/spr/RequestContextHolderTests.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/RequestContextHolderTests.java b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/RequestContextHolderTests.java index 538d529ac5e..b99ed5ccfcf 100644 --- a/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/RequestContextHolderTests.java +++ b/spring-test/src/test/java/org/springframework/test/web/servlet/samples/spr/RequestContextHolderTests.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2018 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,13 +36,14 @@ import org.springframework.context.annotation.ScopedProxyMode; import org.springframework.mock.web.MockHttpServletRequest; import org.springframework.test.annotation.DirtiesContext; import org.springframework.test.context.ContextConfiguration; -import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; +import org.springframework.test.context.junit4.SpringRunner; import org.springframework.test.context.web.WebAppConfiguration; import org.springframework.test.web.servlet.MockMvc; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RestController; import org.springframework.web.context.WebApplicationContext; import org.springframework.web.context.annotation.RequestScope; +import org.springframework.web.context.annotation.SessionScope; import org.springframework.web.context.request.RequestAttributes; import org.springframework.web.context.request.RequestContextHolder; import org.springframework.web.context.request.ServletRequestAttributes; @@ -71,7 +72,7 @@ import static org.springframework.test.web.servlet.setup.MockMvcBuilders.webAppC * @author Sam Brannen * @see CustomRequestAttributesRequestContextHolderTests */ -@RunWith(SpringJUnit4ClassRunner.class) +@RunWith(SpringRunner.class) @WebAppConfiguration @ContextConfiguration @DirtiesContext @@ -163,7 +164,6 @@ public class RequestContextHolderTests { @Bean @RequestScope - @Scope(scopeName = "request", proxyMode = ScopedProxyMode.TARGET_CLASS) public RequestScopedService requestScopedService() { return new RequestScopedService(); } @@ -174,7 +174,7 @@ public class RequestContextHolderTests { } @Bean - @Scope(scopeName = "session", proxyMode = ScopedProxyMode.TARGET_CLASS) + @SessionScope public SessionScopedService sessionScopedService() { return new SessionScopedService(); }