Tabnine Logo
AbstractStringAssert.isNull
Code IndexAdd Tabnine to your IDE (free)

How to use
isNull
method
in
org.assertj.core.api.AbstractStringAssert

Best Java code snippets using org.assertj.core.api.AbstractStringAssert.isNull (Showing top 20 results out of 513)

origin: spring-projects/spring-security

  @Test
  public void getClaimAsStringWhenValueIsNullThenReturnNull() {
    String claimName = "claim-with-null-value";
    this.claims.put(claimName, null);

    assertThat(this.claimAccessor.getClaimAsString(claimName)).isNull();
  }
}
origin: spring-projects/spring-security

@Test
public void constructorWithErrorCodeWhenErrorCodeIsValidThenCreated() {
  BearerTokenError error = new BearerTokenError(TEST_ERROR_CODE, TEST_HTTP_STATUS, null, null);
  assertThat(error.getErrorCode()).isEqualTo(TEST_ERROR_CODE);
  assertThat(error.getHttpStatus()).isEqualTo(TEST_HTTP_STATUS);
  assertThat(error.getDescription()).isNull();
  assertThat(error.getUri()).isNull();
  assertThat(error.getScope()).isNull();
}
origin: spring-projects/spring-security

@Test
public void getAttribute() {
  assertThat(attribute.getAttribute()).isNull();
}
origin: spring-projects/spring-security

@Test
public void deserializeCasAuthenticationTestAfterEraseCredentialInvoked() throws Exception {
  CasAuthenticationToken token = mapper.readValue(CAS_TOKEN_CLEARED_JSON, CasAuthenticationToken.class);
  assertThat(((UserDetails) token.getPrincipal()).getPassword()).isNull();
}
origin: square/wire

@Test public void enclosing() throws Exception {
 assertThat(IdentifierSet.enclosing("a.b.Outer#member")).isEqualTo("a.b.Outer");
 assertThat(IdentifierSet.enclosing("a.b.Outer")).isEqualTo("a.b.*");
 assertThat(IdentifierSet.enclosing("a.b.*")).isEqualTo("a.*");
 assertThat(IdentifierSet.enclosing("a.*")).isEqualTo("*");
 assertThat(IdentifierSet.enclosing("*")).isNull();
}
origin: spring-projects/spring-security

@Test
public void resolveWhenHeaderWithWrongSchemeIsPresentThenTokenIsNotResolved() {
  MockHttpServletRequest request = new MockHttpServletRequest();
  request.addHeader("Authorization", "Basic " + Base64.getEncoder().encodeToString("test:test".getBytes()));
  assertThat(this.resolver.resolve(request)).isNull();
}
origin: spring-projects/spring-security

@Test
public void preAuthorize() {
  this.spring.register(SampleWebSecurityConfig.class).autowire();
  assertThat(this.methodSecurityService.secured()).isNull();
  assertThat(this.methodSecurityService.jsr250()).isNull();
  assertThatThrownBy(() -> this.methodSecurityService.preAuthorize())
    .isInstanceOf(AccessDeniedException.class);
}
origin: spring-projects/spring-security

@Test
public void testNullContextHolderIsNull() throws Exception {
  SecurityContextHolder.getContext().setAuthentication(null);
  // Create a connection and ensure our executor sets its
  // properties correctly
  AuthenticationSimpleHttpInvokerRequestExecutor executor = new AuthenticationSimpleHttpInvokerRequestExecutor();
  HttpURLConnection conn = new MockHttpURLConnection(new URL("http://localhost/"));
  executor.prepareConnection(conn, 10);
  // Check connection properties (shouldn't be an Authorization header)
  assertThat(conn.getRequestProperty("Authorization")).isNull();
}
origin: spring-projects/spring-security

@Test
public void deserializeUserWithNullPasswordNoAuthorityTest() throws Exception {
  String userJsonWithoutPasswordString = removeNode(userWithNoAuthoritiesJson(), mapper, "password");
  User user = mapper.readValue(userJsonWithoutPasswordString, User.class);
  assertThat(user).isNotNull();
  assertThat(user.getUsername()).isEqualTo("admin");
  assertThat(user.getPassword()).isNull();
  assertThat(user.getAuthorities()).isEmpty();
  assertThat(user.isEnabled()).isEqualTo(true);
}
origin: spring-projects/spring-security

@Test
public void resolveWhenNoHeaderIsPresentThenTokenIsNotResolved() {
  MockHttpServletRequest request = new MockHttpServletRequest();
  assertThat(this.resolver.resolve(request)).isNull();
}
origin: spring-projects/spring-security

@Test
public void customPermissionHandler() {
  this.spring.register(CustomPermissionEvaluatorWebSecurityConfig.class).autowire();
  assertThat(this.methodSecurityService.hasPermission("allowed")).isNull();
  assertThatThrownBy(() -> this.methodSecurityService.hasPermission("denied"))
    .isInstanceOf(AccessDeniedException.class);
}
origin: spring-projects/spring-security

@Test
public void resourceContainsExpectedData() throws Exception {
  InMemoryResource resource = new InMemoryResource("blah");
  assertThat(resource.getDescription()).isNull();
  assertThat(resource.hashCode()).isEqualTo(1);
  assertThat(resource.getInputStream()).isNotNull();
}
origin: spring-projects/spring-security

@Test
public void matchersFalse() {
  messages.matchers(matcher).permitAll();
  assertThat(getAttribute()).isNull();
}
origin: spring-projects/spring-security

@Test
public void filterWhenAuthorizedClientNullThenAuthorizationHeaderNull() {
  ClientRequest request = ClientRequest.create(GET, URI.create("https://example.com"))
    .build();
  this.function.filter(request, this.exchange).block();
  assertThat(this.exchange.getRequest().headers().getFirst(HttpHeaders.AUTHORIZATION)).isNull();
}
origin: spring-projects/spring-security

@Test
public void filterWhenAuthorizedClientNullThenAuthorizationHeaderNull() {
  ClientRequest request = ClientRequest.create(GET, URI.create("https://example.com"))
      .build();
  this.function.filter(request, this.exchange).block();
  assertThat(this.exchange.getRequest().headers().getFirst(HttpHeaders.AUTHORIZATION)).isNull();
}
origin: spring-projects/spring-security

  @Test
  public void resolveWhenQueryParameterIsPresentAndNotSupportedThenTokenIsNotResolved() {
    MockHttpServletRequest request = new MockHttpServletRequest();
    request.setMethod("GET");
    request.addParameter("access_token", TEST_TOKEN);

    assertThat(this.resolver.resolve(request)).isNull();
  }
}
origin: spring-projects/spring-security

@Test
public void getNameWhenJwtHasNoSubjectThenReturnsNull() {
  Jwt jwt = this.jwt(Maps.newHashMap("claim", "value"));
  JwtAuthenticationToken token = new JwtAuthenticationToken(jwt);
  assertThat(token.getName()).isNull();
}
origin: spring-projects/spring-security

@Test
public void resolveWhenFormParameterIsPresentAndNotSupportedThenTokenIsNotResolved() {
  MockHttpServletRequest request = new MockHttpServletRequest();
  request.setMethod("POST");
  request.setContentType("application/x-www-form-urlencoded");
  request.addParameter("access_token", TEST_TOKEN);
  assertThat(this.resolver.resolve(request)).isNull();
}
origin: spring-projects/spring-security

@Test
public void findByUsernameWhenClearCredentialsThenFindByUsernameStillHasCredentials() {
  User foundUser = users.findByUsername(USER_DETAILS.getUsername()).cast(User.class).block();
  assertThat(foundUser.getPassword()).isNotEmpty();
  foundUser.eraseCredentials();
  assertThat(foundUser.getPassword()).isNull();
  foundUser = users.findByUsername(USER_DETAILS.getUsername()).cast(User.class).block();
  assertThat(foundUser.getPassword()).isNotEmpty();
}
origin: spring-projects/spring-security

@Test
public void credentialsAreCleared() {
  LdapUserDetailsImpl.Essence mutableLdapUserDetails = new LdapUserDetailsImpl.Essence();
  mutableLdapUserDetails.setDn("uid=username1,ou=people,dc=example,dc=com");
  mutableLdapUserDetails.setUsername("username1");
  mutableLdapUserDetails.setPassword("password");
  LdapUserDetails ldapUserDetails = mutableLdapUserDetails.createUserDetails();
  assertThat(ldapUserDetails).isInstanceOf(CredentialsContainer.class);
  ldapUserDetails.eraseCredentials();
  assertThat(ldapUserDetails.getPassword()).isNull();
}
org.assertj.core.apiAbstractStringAssertisNull

Popular methods of AbstractStringAssert

  • isEqualTo
  • contains
  • isNotNull
  • startsWith
  • isEmpty
  • isNotEqualTo
  • isNotEmpty
  • doesNotContain
  • as
  • matches
  • endsWith
  • isEqualToIgnoringCase
  • endsWith,
  • isEqualToIgnoringCase,
  • containsPattern,
  • isSameAs,
  • isEqualToIgnoringWhitespace,
  • isIn,
  • isNotBlank,
  • describedAs,
  • isEqualToNormalizingNewlines

Popular in Java

  • Making http requests using okhttp
  • compareTo (BigDecimal)
  • getResourceAsStream (ClassLoader)
  • onCreateOptionsMenu (Activity)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • Runner (org.openjdk.jmh.runner)
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now