|
@@ -17,7 +17,7 @@ package org.springframework.security.captcha;
|
|
|
|
|
|
import junit.framework.TestCase;
|
|
import junit.framework.TestCase;
|
|
|
|
|
|
-import org.springframework.security.ConfigAttributeDefinition;
|
|
|
|
|
|
+import org.springframework.security.ConfigAttribute;
|
|
import org.springframework.security.SecurityConfig;
|
|
import org.springframework.security.SecurityConfig;
|
|
|
|
|
|
import org.springframework.security.context.SecurityContextHolder;
|
|
import org.springframework.security.context.SecurityContextHolder;
|
|
@@ -28,6 +28,7 @@ import org.springframework.mock.web.MockHttpServletRequest;
|
|
import org.springframework.mock.web.MockHttpServletResponse;
|
|
import org.springframework.mock.web.MockHttpServletResponse;
|
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
|
+import java.util.List;
|
|
|
|
|
|
import javax.servlet.ServletException;
|
|
import javax.servlet.ServletException;
|
|
import javax.servlet.FilterChain;
|
|
import javax.servlet.FilterChain;
|
|
@@ -44,7 +45,7 @@ import javax.servlet.ServletResponse;
|
|
public class CaptchaChannelProcessorTemplateTests extends TestCase {
|
|
public class CaptchaChannelProcessorTemplateTests extends TestCase {
|
|
//~ Methods ========================================================================================================
|
|
//~ Methods ========================================================================================================
|
|
|
|
|
|
- private MockHttpServletResponse decideWithNewResponse(ConfigAttributeDefinition cad,
|
|
|
|
|
|
+ private MockHttpServletResponse decideWithNewResponse(List<ConfigAttribute> cad,
|
|
CaptchaChannelProcessorTemplate processor, MockHttpServletRequest request)
|
|
CaptchaChannelProcessorTemplate processor, MockHttpServletRequest request)
|
|
throws IOException, ServletException {
|
|
throws IOException, ServletException {
|
|
MockHttpServletResponse response;
|
|
MockHttpServletResponse response;
|
|
@@ -70,7 +71,7 @@ public class CaptchaChannelProcessorTemplateTests extends TestCase {
|
|
CaptchaChannelProcessorTemplate processor = new TestHumanityCaptchaChannelProcessor();
|
|
CaptchaChannelProcessorTemplate processor = new TestHumanityCaptchaChannelProcessor();
|
|
processor.setKeyword("X");
|
|
processor.setKeyword("X");
|
|
|
|
|
|
- ConfigAttributeDefinition cad = new ConfigAttributeDefinition("Y");
|
|
|
|
|
|
+ List<ConfigAttribute> cad = SecurityConfig.createList("Y");
|
|
|
|
|
|
CaptchaSecurityContext context = new CaptchaSecurityContextImpl();
|
|
CaptchaSecurityContext context = new CaptchaSecurityContextImpl();
|
|
SecurityContextHolder.setContext(context);
|
|
SecurityContextHolder.setContext(context);
|
|
@@ -136,7 +137,7 @@ public class CaptchaChannelProcessorTemplateTests extends TestCase {
|
|
CaptchaChannelProcessorTemplate processor = new TestHumanityCaptchaChannelProcessor();
|
|
CaptchaChannelProcessorTemplate processor = new TestHumanityCaptchaChannelProcessor();
|
|
processor.setKeyword("X");
|
|
processor.setKeyword("X");
|
|
|
|
|
|
- ConfigAttributeDefinition cad = new ConfigAttributeDefinition("X");
|
|
|
|
|
|
+ List<ConfigAttribute> cad = SecurityConfig.createList("X");
|
|
CaptchaSecurityContext context = new CaptchaSecurityContextImpl();
|
|
CaptchaSecurityContext context = new CaptchaSecurityContextImpl();
|
|
SecurityContextHolder.setContext(context);
|
|
SecurityContextHolder.setContext(context);
|
|
|
|
|
|
@@ -224,5 +225,5 @@ public class CaptchaChannelProcessorTemplateTests extends TestCase {
|
|
public void doFilter(ServletRequest arg0, ServletResponse arg1) throws IOException, ServletException {
|
|
public void doFilter(ServletRequest arg0, ServletResponse arg1) throws IOException, ServletException {
|
|
throw new UnsupportedOperationException("mock method not implemented");
|
|
throw new UnsupportedOperationException("mock method not implemented");
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|