mirror of
				https://github.com/spring-projects/spring-security.git
				synced 2025-10-30 22:28:46 +00:00 
			
		
		
		
	Entry point tests
This commit is contained in:
		
							parent
							
								
									a056946c49
								
							
						
					
					
						commit
						2a6c68deb6
					
				| @ -0,0 +1,44 @@ | ||||
| package net.sf.acegisecurity.ui.x509; | ||||
| 
 | ||||
| import junit.framework.TestCase; | ||||
| 
 | ||||
| import net.sf.acegisecurity.BadCredentialsException; | ||||
| import org.springframework.mock.web.MockHttpServletRequest; | ||||
| import org.springframework.mock.web.MockHttpServletResponse; | ||||
| 
 | ||||
| import javax.servlet.http.HttpServletResponse; | ||||
| 
 | ||||
| 
 | ||||
| /** | ||||
|  * Tests {@link X509ProcessingFilterEntryPoint}. | ||||
|  * | ||||
|  * @author Luke Taylor | ||||
|  * @version $Id$ | ||||
|  */ | ||||
| public class X509ProcessingFilterEntryPointTests extends TestCase { | ||||
|     //~ Constructors =========================================================== | ||||
| 
 | ||||
|     public X509ProcessingFilterEntryPointTests() { | ||||
|         super(); | ||||
|     } | ||||
| 
 | ||||
|     public X509ProcessingFilterEntryPointTests(String arg0) { | ||||
|         super(arg0); | ||||
|     } | ||||
| 
 | ||||
|     //~ Methods ================================================================ | ||||
| 
 | ||||
|     public final void setUp() throws Exception { | ||||
|         super.setUp(); | ||||
|     } | ||||
| 
 | ||||
|     public void testNormalOperation() throws Exception { | ||||
|         MockHttpServletRequest request = new MockHttpServletRequest(); | ||||
|         MockHttpServletResponse response = new MockHttpServletResponse(); | ||||
|         X509ProcessingFilterEntryPoint entryPoint = new X509ProcessingFilterEntryPoint(); | ||||
| 
 | ||||
|         entryPoint.commence(request, response, new BadCredentialsException("As thrown by security enforcement filter")); | ||||
|         assertEquals(HttpServletResponse.SC_FORBIDDEN, response.getStatus()); | ||||
| 
 | ||||
|     } | ||||
| } | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user