mirror of
https://github.com/spring-projects/spring-security.git
synced 2025-07-24 11:13:30 +00:00
Replace isEqualTo(null) with isNull()
This commit is contained in:
parent
4de3d0b860
commit
68878a1675
@ -154,11 +154,11 @@ public class EhCacheBasedAclCacheTests {
|
|||||||
|
|
||||||
Object retrieved1 = FieldUtils.getProtectedFieldValue("aclAuthorizationStrategy",
|
Object retrieved1 = FieldUtils.getProtectedFieldValue("aclAuthorizationStrategy",
|
||||||
retrieved);
|
retrieved);
|
||||||
assertThat(retrieved1).isEqualTo(null);
|
assertThat(retrieved1).isNull();
|
||||||
|
|
||||||
Object retrieved2 = FieldUtils.getProtectedFieldValue(
|
Object retrieved2 = FieldUtils.getProtectedFieldValue(
|
||||||
"permissionGrantingStrategy", retrieved);
|
"permissionGrantingStrategy", retrieved);
|
||||||
assertThat(retrieved2).isEqualTo(null);
|
assertThat(retrieved2).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -353,7 +353,7 @@ public class CasAuthenticationProviderTests {
|
|||||||
assertThat(cap.supports(TestingAuthenticationToken.class)).isFalse();
|
assertThat(cap.supports(TestingAuthenticationToken.class)).isFalse();
|
||||||
|
|
||||||
// Try it anyway
|
// Try it anyway
|
||||||
assertThat(cap.authenticate(token)).isEqualTo(null);
|
assertThat(cap.authenticate(token)).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@ -370,7 +370,7 @@ public class CasAuthenticationProviderTests {
|
|||||||
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(
|
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(
|
||||||
"some_normal_user", "password",
|
"some_normal_user", "password",
|
||||||
AuthorityUtils.createAuthorityList("ROLE_A"));
|
AuthorityUtils.createAuthorityList("ROLE_A"));
|
||||||
assertThat(cap.authenticate(token)).isEqualTo(null);
|
assertThat(cap.authenticate(token)).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -108,7 +108,7 @@ public class FilterChainProxyConfigTests {
|
|||||||
public void pathWithNoMatchHasNoFilters() throws Exception {
|
public void pathWithNoMatchHasNoFilters() throws Exception {
|
||||||
FilterChainProxy filterChainProxy = appCtx.getBean(
|
FilterChainProxy filterChainProxy = appCtx.getBean(
|
||||||
"newFilterChainProxyNoDefaultPath", FilterChainProxy.class);
|
"newFilterChainProxyNoDefaultPath", FilterChainProxy.class);
|
||||||
assertThat(filterChainProxy.getFilters("/nomatch")).isEqualTo(null);
|
assertThat(filterChainProxy.getFilters("/nomatch")).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
// SEC-1235
|
// SEC-1235
|
||||||
|
@ -52,7 +52,7 @@ public class RunAsManagerImplTests {
|
|||||||
|
|
||||||
Authentication resultingToken = runAs.buildRunAs(inputToken, new Object(),
|
Authentication resultingToken = runAs.buildRunAs(inputToken, new Object(),
|
||||||
SecurityConfig.createList("SOMETHING_WE_IGNORE"));
|
SecurityConfig.createList("SOMETHING_WE_IGNORE"));
|
||||||
assertThat(resultingToken).isEqualTo(null);
|
assertThat(resultingToken).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -103,7 +103,7 @@ public class SecurityContextLoginModuleTests {
|
|||||||
this.module.login();
|
this.module.login();
|
||||||
assertThat(this.module.logout()).as("Should return true as it succeeds").isTrue();
|
assertThat(this.module.logout()).as("Should return true as it succeeds").isTrue();
|
||||||
assertThat(this.module.getAuthentication()).as("Authentication should be null")
|
assertThat(this.module.getAuthentication()).as("Authentication should be null")
|
||||||
.isEqualTo(null);
|
.isNull();
|
||||||
|
|
||||||
assertThat(this.subject.getPrincipals().contains(this.auth))
|
assertThat(this.subject.getPrincipals().contains(this.auth))
|
||||||
.withFailMessage(
|
.withFailMessage(
|
||||||
|
@ -99,6 +99,6 @@ public class ClaimAccessorTests {
|
|||||||
String claimName = "claim-with-null-value";
|
String claimName = "claim-with-null-value";
|
||||||
this.claims.put(claimName, null);
|
this.claims.put(claimName, null);
|
||||||
|
|
||||||
assertThat(this.claimAccessor.getClaimAsString(claimName)).isEqualTo(null);
|
assertThat(this.claimAccessor.getClaimAsString(claimName)).isNull();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -216,7 +216,7 @@ public class OpenIDAuthenticationProviderTests {
|
|||||||
|
|
||||||
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(
|
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(
|
||||||
USERNAME, "password");
|
USERNAME, "password");
|
||||||
assertThat(provider.authenticate(token)).isEqualTo(null);
|
assertThat(provider.authenticate(token)).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -101,7 +101,7 @@ public class AuthenticationTagTests {
|
|||||||
authenticationTag.setProperty("principal");
|
authenticationTag.setProperty("principal");
|
||||||
assertThat(authenticationTag.doStartTag()).isEqualTo(Tag.SKIP_BODY);
|
assertThat(authenticationTag.doStartTag()).isEqualTo(Tag.SKIP_BODY);
|
||||||
assertThat(authenticationTag.doEndTag()).isEqualTo(Tag.EVAL_PAGE);
|
assertThat(authenticationTag.doEndTag()).isEqualTo(Tag.EVAL_PAGE);
|
||||||
assertThat(authenticationTag.getLastMessage()).isEqualTo(null);
|
assertThat(authenticationTag.getLastMessage()).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -108,7 +108,7 @@ public class SimpleUrlAuthenticationSuccessHandlerTests {
|
|||||||
SimpleUrlAuthenticationSuccessHandler ash = new SimpleUrlAuthenticationSuccessHandler();
|
SimpleUrlAuthenticationSuccessHandler ash = new SimpleUrlAuthenticationSuccessHandler();
|
||||||
ash.setTargetUrlParameter("targetUrl");
|
ash.setTargetUrlParameter("targetUrl");
|
||||||
ash.setTargetUrlParameter(null);
|
ash.setTargetUrlParameter(null);
|
||||||
assertThat(ash.getTargetUrlParameter()).isEqualTo(null);
|
assertThat(ash.getTargetUrlParameter()).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -147,7 +147,7 @@ public class AbstractPreAuthenticatedProcessingFilterTests {
|
|||||||
filter.doFilter(new MockHttpServletRequest(), new MockHttpServletResponse(),
|
filter.doFilter(new MockHttpServletRequest(), new MockHttpServletResponse(),
|
||||||
new MockFilterChain());
|
new MockFilterChain());
|
||||||
|
|
||||||
assertThat(SecurityContextHolder.getContext().getAuthentication()).isEqualTo(null);
|
assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
Loading…
x
Reference in New Issue
Block a user