Removal of deprecated methods and classes.

This commit is contained in:
Luke Taylor
2010-06-26 16:23:42 +01:00
parent 6a79cf7be2
commit 026517f674
22 changed files with 162 additions and 1018 deletions

View File

@@ -18,20 +18,6 @@ import org.springframework.security.web.context.SaveContextOnUpdateOrErrorRespon
public class HttpSessionSecurityContextRepositoryTests {
private final TestingAuthenticationToken testToken = new TestingAuthenticationToken("someone", "passwd", "ROLE_A");
@Test(expected=IllegalArgumentException.class)
@Deprecated
public void detectsInvalidContextClass() throws Exception {
HttpSessionSecurityContextRepository repo = new HttpSessionSecurityContextRepository();
repo.setSecurityContextClass(String.class);
}
@Deprecated
@Test(expected=IllegalArgumentException.class)
public void cannotSetNullContextClass() throws Exception {
HttpSessionSecurityContextRepository repo = new HttpSessionSecurityContextRepository();
repo.setSecurityContextClass(null);
}
@Test
public void sessionIsntCreatedIfContextDoesntChange() throws Exception {
HttpSessionSecurityContextRepository repo = new HttpSessionSecurityContextRepository();
@@ -162,30 +148,6 @@ public class HttpSessionSecurityContextRepositoryTests {
assertNull(request.getSession(false));
}
@Test
@Deprecated
public void settingCloneFromContextLoadsClonedContextObject() throws Exception {
HttpSessionSecurityContextRepository repo = new HttpSessionSecurityContextRepository();
repo.setCloneFromHttpSession(true);
MockHttpServletRequest request = new MockHttpServletRequest();
MockContext contextBefore = new MockContext();
request.getSession().setAttribute(HttpSessionSecurityContextRepository.SPRING_SECURITY_CONTEXT_KEY, contextBefore);
contextBefore.setAuthentication(testToken);
MockHttpServletResponse response = new MockHttpServletResponse();
HttpRequestResponseHolder holder = new HttpRequestResponseHolder(request, response);
SecurityContext loadedContext = repo.loadContext(holder);
assertTrue(loadedContext instanceof MockContext);
assertFalse(loadedContext == contextBefore);
}
@Test
@Deprecated
public void generateNewContextWorksWithContextClass() throws Exception {
HttpSessionSecurityContextRepository repo = new HttpSessionSecurityContextRepository();
repo.setSecurityContextClass(MockContext.class);
assertTrue(repo.generateNewContext() instanceof MockContext);
}
@Test
@SuppressWarnings("deprecation")
public void sessionDisableUrlRewritingPreventsSessionIdBeingWrittenToUrl() throws Exception {