Replace isEqualTo(null) with isNull()

This commit is contained in:
Johnny Lim 2018-08-07 01:26:57 +09:00 committed by Josh Cummings
parent 4de3d0b860
commit 68878a1675
10 changed files with 12 additions and 12 deletions

View File

@ -154,11 +154,11 @@ public class EhCacheBasedAclCacheTests {
Object retrieved1 = FieldUtils.getProtectedFieldValue("aclAuthorizationStrategy",
retrieved);
assertThat(retrieved1).isEqualTo(null);
assertThat(retrieved1).isNull();
Object retrieved2 = FieldUtils.getProtectedFieldValue(
"permissionGrantingStrategy", retrieved);
assertThat(retrieved2).isEqualTo(null);
assertThat(retrieved2).isNull();
}
@Test

View File

@ -353,7 +353,7 @@ public class CasAuthenticationProviderTests {
assertThat(cap.supports(TestingAuthenticationToken.class)).isFalse();
// Try it anyway
assertThat(cap.authenticate(token)).isEqualTo(null);
assertThat(cap.authenticate(token)).isNull();
}
@Test
@ -370,7 +370,7 @@ public class CasAuthenticationProviderTests {
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(
"some_normal_user", "password",
AuthorityUtils.createAuthorityList("ROLE_A"));
assertThat(cap.authenticate(token)).isEqualTo(null);
assertThat(cap.authenticate(token)).isNull();
}
@Test

View File

@ -108,7 +108,7 @@ public class FilterChainProxyConfigTests {
public void pathWithNoMatchHasNoFilters() throws Exception {
FilterChainProxy filterChainProxy = appCtx.getBean(
"newFilterChainProxyNoDefaultPath", FilterChainProxy.class);
assertThat(filterChainProxy.getFilters("/nomatch")).isEqualTo(null);
assertThat(filterChainProxy.getFilters("/nomatch")).isNull();
}
// SEC-1235

View File

@ -52,7 +52,7 @@ public class RunAsManagerImplTests {
Authentication resultingToken = runAs.buildRunAs(inputToken, new Object(),
SecurityConfig.createList("SOMETHING_WE_IGNORE"));
assertThat(resultingToken).isEqualTo(null);
assertThat(resultingToken).isNull();
}
@Test

View File

@ -103,7 +103,7 @@ public class SecurityContextLoginModuleTests {
this.module.login();
assertThat(this.module.logout()).as("Should return true as it succeeds").isTrue();
assertThat(this.module.getAuthentication()).as("Authentication should be null")
.isEqualTo(null);
.isNull();
assertThat(this.subject.getPrincipals().contains(this.auth))
.withFailMessage(

View File

@ -99,6 +99,6 @@ public class ClaimAccessorTests {
String claimName = "claim-with-null-value";
this.claims.put(claimName, null);
assertThat(this.claimAccessor.getClaimAsString(claimName)).isEqualTo(null);
assertThat(this.claimAccessor.getClaimAsString(claimName)).isNull();
}
}

View File

@ -216,7 +216,7 @@ public class OpenIDAuthenticationProviderTests {
UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken(
USERNAME, "password");
assertThat(provider.authenticate(token)).isEqualTo(null);
assertThat(provider.authenticate(token)).isNull();
}
/*

View File

@ -101,7 +101,7 @@ public class AuthenticationTagTests {
authenticationTag.setProperty("principal");
assertThat(authenticationTag.doStartTag()).isEqualTo(Tag.SKIP_BODY);
assertThat(authenticationTag.doEndTag()).isEqualTo(Tag.EVAL_PAGE);
assertThat(authenticationTag.getLastMessage()).isEqualTo(null);
assertThat(authenticationTag.getLastMessage()).isNull();
}
@Test

View File

@ -108,7 +108,7 @@ public class SimpleUrlAuthenticationSuccessHandlerTests {
SimpleUrlAuthenticationSuccessHandler ash = new SimpleUrlAuthenticationSuccessHandler();
ash.setTargetUrlParameter("targetUrl");
ash.setTargetUrlParameter(null);
assertThat(ash.getTargetUrlParameter()).isEqualTo(null);
assertThat(ash.getTargetUrlParameter()).isNull();
}
@Test

View File

@ -147,7 +147,7 @@ public class AbstractPreAuthenticatedProcessingFilterTests {
filter.doFilter(new MockHttpServletRequest(), new MockHttpServletResponse(),
new MockFilterChain());
assertThat(SecurityContextHolder.getContext().getAuthentication()).isEqualTo(null);
assertThat(SecurityContextHolder.getContext().getAuthentication()).isNull();
}
@Test