mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-06-28 23:02:15 +00:00
Renamed **/Test.java to **/Tests.java to better follow conventions
This commit is contained in:
parent
aabb16912f
commit
8ca2927761
@ -13,7 +13,7 @@ import java.util.*;
|
|||||||
* @author Ruud Senden
|
* @author Ruud Senden
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public class MapBasedAttributes2GrantedAuthoritiesMapperTest {
|
public class MapBasedAttributes2GrantedAuthoritiesMapperTests {
|
||||||
|
|
||||||
@Test(expected=IllegalArgumentException.class)
|
@Test(expected=IllegalArgumentException.class)
|
||||||
public void testAfterPropertiesSetNoMap() throws Exception {
|
public void testAfterPropertiesSetNoMap() throws Exception {
|
@ -34,7 +34,7 @@ import org.junit.Test;
|
|||||||
* @author Mike Wiesner
|
* @author Mike Wiesner
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
*/
|
*/
|
||||||
public class JndiDnsResolverTest {
|
public class JndiDnsResolverTests {
|
||||||
|
|
||||||
private JndiDnsResolver dnsResolver;
|
private JndiDnsResolver dnsResolver;
|
||||||
private InitialContextFactory contextFactory;
|
private InitialContextFactory contextFactory;
|
@ -22,7 +22,7 @@ import org.springframework.security.core.context.SecurityContextHolder;
|
|||||||
import javax.servlet.jsp.JspException;
|
import javax.servlet.jsp.JspException;
|
||||||
|
|
||||||
|
|
||||||
public class AuthzImplAttributeTest extends TestCase {
|
public class AuthzImplAttributeTests extends TestCase {
|
||||||
//~ Instance fields ================================================================================================
|
//~ Instance fields ================================================================================================
|
||||||
|
|
||||||
private final Authz authz = new AuthzImpl();
|
private final Authz authz = new AuthzImpl();
|
@ -19,7 +19,7 @@ import junit.framework.TestCase;
|
|||||||
import org.springframework.security.authentication.TestingAuthenticationToken;
|
import org.springframework.security.authentication.TestingAuthenticationToken;
|
||||||
import org.springframework.security.core.context.SecurityContextHolder;
|
import org.springframework.security.core.context.SecurityContextHolder;
|
||||||
|
|
||||||
public class AuthzImplAuthorizeTagTest extends TestCase {
|
public class AuthzImplAuthorizeTagTests extends TestCase {
|
||||||
//~ Instance fields ================================================================================================
|
//~ Instance fields ================================================================================================
|
||||||
|
|
||||||
private Authz authz = new AuthzImpl();
|
private Authz authz = new AuthzImpl();
|
@ -18,7 +18,7 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
|||||||
|
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
@ContextConfiguration(locations = "classpath:org/springframework/security/web/authentication/DelegatingAuthenticationEntryPointTest-context.xml")
|
@ContextConfiguration(locations = "classpath:org/springframework/security/web/authentication/DelegatingAuthenticationEntryPointTest-context.xml")
|
||||||
public class DelegatingAuthenticationEntryPointContextTest {
|
public class DelegatingAuthenticationEntryPointContextTests {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private DelegatingAuthenticationEntryPoint daep;
|
private DelegatingAuthenticationEntryPoint daep;
|
@ -29,18 +29,18 @@ import org.springframework.security.web.util.RequestMatcher;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Test class for {@link DelegatingAuthenticationEntryPoint}
|
* Test class for {@link DelegatingAuthenticationEntryPoint}
|
||||||
*
|
*
|
||||||
* @author Mike Wiesner
|
* @author Mike Wiesner
|
||||||
* @since 3.0.2
|
* @since 3.0.2
|
||||||
* @version $Id:$
|
* @version $Id:$
|
||||||
*/
|
*/
|
||||||
public class DelegatingAuthenticationEntryPointTest {
|
public class DelegatingAuthenticationEntryPointTests {
|
||||||
|
|
||||||
private DelegatingAuthenticationEntryPoint daep;
|
private DelegatingAuthenticationEntryPoint daep;
|
||||||
private LinkedHashMap<RequestMatcher, AuthenticationEntryPoint> entryPoints;
|
private LinkedHashMap<RequestMatcher, AuthenticationEntryPoint> entryPoints;
|
||||||
private AuthenticationEntryPoint defaultEntryPoint;
|
private AuthenticationEntryPoint defaultEntryPoint;
|
||||||
private HttpServletRequest request = new MockHttpServletRequest();
|
private HttpServletRequest request = new MockHttpServletRequest();
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void before() {
|
public void before() {
|
||||||
defaultEntryPoint = mock(AuthenticationEntryPoint.class);
|
defaultEntryPoint = mock(AuthenticationEntryPoint.class);
|
||||||
@ -48,20 +48,20 @@ public class DelegatingAuthenticationEntryPointTest {
|
|||||||
daep = new DelegatingAuthenticationEntryPoint(entryPoints);
|
daep = new DelegatingAuthenticationEntryPoint(entryPoints);
|
||||||
daep.setDefaultEntryPoint(defaultEntryPoint);
|
daep.setDefaultEntryPoint(defaultEntryPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testDefaultEntryPoint() throws Exception {
|
public void testDefaultEntryPoint() throws Exception {
|
||||||
AuthenticationEntryPoint firstAEP = mock(AuthenticationEntryPoint.class);
|
AuthenticationEntryPoint firstAEP = mock(AuthenticationEntryPoint.class);
|
||||||
RequestMatcher firstRM = mock(RequestMatcher.class);
|
RequestMatcher firstRM = mock(RequestMatcher.class);
|
||||||
when(firstRM.matches(request)).thenReturn(false);
|
when(firstRM.matches(request)).thenReturn(false);
|
||||||
entryPoints.put(firstRM, firstAEP);
|
entryPoints.put(firstRM, firstAEP);
|
||||||
|
|
||||||
daep.commence(request, null, null);
|
daep.commence(request, null, null);
|
||||||
|
|
||||||
verify(defaultEntryPoint).commence(request, null, null);
|
verify(defaultEntryPoint).commence(request, null, null);
|
||||||
verify(firstAEP, never()).commence(request, null, null);
|
verify(firstAEP, never()).commence(request, null, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testFirstEntryPoint() throws Exception {
|
public void testFirstEntryPoint() throws Exception {
|
||||||
AuthenticationEntryPoint firstAEP = mock(AuthenticationEntryPoint.class);
|
AuthenticationEntryPoint firstAEP = mock(AuthenticationEntryPoint.class);
|
||||||
@ -71,15 +71,15 @@ public class DelegatingAuthenticationEntryPointTest {
|
|||||||
when(firstRM.matches(request)).thenReturn(true);
|
when(firstRM.matches(request)).thenReturn(true);
|
||||||
entryPoints.put(firstRM, firstAEP);
|
entryPoints.put(firstRM, firstAEP);
|
||||||
entryPoints.put(secondRM, secondAEP);
|
entryPoints.put(secondRM, secondAEP);
|
||||||
|
|
||||||
daep.commence(request, null, null);
|
daep.commence(request, null, null);
|
||||||
|
|
||||||
verify(firstAEP).commence(request, null, null);
|
verify(firstAEP).commence(request, null, null);
|
||||||
verify(secondAEP, never()).commence(request, null, null);
|
verify(secondAEP, never()).commence(request, null, null);
|
||||||
verify(defaultEntryPoint, never()).commence(request, null, null);
|
verify(defaultEntryPoint, never()).commence(request, null, null);
|
||||||
verify(secondRM, never()).matches(request);
|
verify(secondRM, never()).matches(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testSecondEntryPoint() throws Exception {
|
public void testSecondEntryPoint() throws Exception {
|
||||||
AuthenticationEntryPoint firstAEP = mock(AuthenticationEntryPoint.class);
|
AuthenticationEntryPoint firstAEP = mock(AuthenticationEntryPoint.class);
|
||||||
@ -90,9 +90,9 @@ public class DelegatingAuthenticationEntryPointTest {
|
|||||||
when(secondRM.matches(request)).thenReturn(true);
|
when(secondRM.matches(request)).thenReturn(true);
|
||||||
entryPoints.put(firstRM, firstAEP);
|
entryPoints.put(firstRM, firstAEP);
|
||||||
entryPoints.put(secondRM, secondAEP);
|
entryPoints.put(secondRM, secondAEP);
|
||||||
|
|
||||||
daep.commence(request, null, null);
|
daep.commence(request, null, null);
|
||||||
|
|
||||||
verify(secondAEP).commence(request, null, null);
|
verify(secondAEP).commence(request, null, null);
|
||||||
verify(firstAEP, never()).commence(request, null, null);
|
verify(firstAEP, never()).commence(request, null, null);
|
||||||
verify(defaultEntryPoint, never()).commence(request, null, null);
|
verify(defaultEntryPoint, never()).commence(request, null, null);
|
@ -57,7 +57,7 @@ import org.springframework.security.web.jaasapi.JaasApiIntegrationFilter;
|
|||||||
*
|
*
|
||||||
* @author Rob Winch
|
* @author Rob Winch
|
||||||
*/
|
*/
|
||||||
public class JaasApiIntegrationFilterTest {
|
public class JaasApiIntegrationFilterTests {
|
||||||
//~ Instance fields ================================================================================================
|
//~ Instance fields ================================================================================================
|
||||||
private JaasApiIntegrationFilter filter;
|
private JaasApiIntegrationFilter filter;
|
||||||
private MockHttpServletRequest request;
|
private MockHttpServletRequest request;
|
Loading…
x
Reference in New Issue
Block a user