congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
AbstractStringAssert.isEmpty
Code IndexAdd Tabnine to your IDE (free)

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

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

origin: reactor/reactor-core

@Test
public void nullScenarioEmpty() {
  assertThat(new ErrorFormatter(null).scenarioPrefix)
      .isNotNull()
      .isEmpty();
}
origin: apache/geode

@Test
public void testGeodeLogLevel() {
 when(parseResult.getParamValueAsString("log-level")).thenReturn("fine");
 when(parseResult.getParamValueAsString("loglevel")).thenReturn("fine");
 for (AbstractCliAroundInterceptor interceptor : interceptors) {
  result = (Result) interceptor.preExecution(parseResult);
  assertThat(result.nextLine()).isEmpty();
 }
}
origin: apache/geode

 @Test
 public void testLog4JLevel() {
  when(parseResult.getParamValueAsString("log-level")).thenReturn("trace");
  when(parseResult.getParamValueAsString("loglevel")).thenReturn("trace");
  for (AbstractCliAroundInterceptor interceptor : interceptors) {
   result = (Result) interceptor.preExecution(parseResult);
   assertThat(result.nextLine()).isEmpty();
  }
 }
}
origin: reactor/reactor-core

@Test
public void noScenarioEmpty() {
  assertThat(new ErrorFormatter("").scenarioPrefix)
      .isNotNull()
      .isEmpty();
}
origin: spring-projects/spring-session

@Test
public void onDeleteSessionMulti() {
  this.resolver.expireSession(this.request, this.response);
  this.resolver.expireSession(this.request, this.response);
  assertThat(this.response.getHeaders(HEADER_X_AUTH_TOKEN).size()).isEqualTo(1);
  assertThat(getSessionId()).isEmpty();
}
origin: spring-projects/spring-session

@Test
public void onDeleteSession() {
  this.resolver.expireSession(this.request, this.response);
  assertThat(getSessionId()).isEmpty();
}
origin: spring-projects/spring-session

@Test
public void onDeleteSession() throws Exception {
  this.strategy.expireSession(this.request, this.response);
  assertThat(getSessionId()).isEmpty();
}
origin: jdbi/jdbi

  @Test
  public void testDefineNullDoesntWriteToStderr() {
    assertThat(h.createQuery("select true<if(defined)>broken<endif>")
        .define("defined", null)
        .mapTo(boolean.class)
        .findOnly())
      .isEqualTo(true);
    assertThat(err.toString()).isEmpty();
  }
}
origin: apache/geode

@Test
public void testStartEnd() {
 when(parseResult.getParamValueAsString("start-time")).thenReturn("2000/01/01");
 when(parseResult.getParamValueAsString("end-time")).thenReturn("2000/01/02");
 result = interceptor.preExecution(parseResult);
 assertThat(result.nextLine()).isEmpty();
 when(parseResult.getParamValueAsString("start-time")).thenReturn("2000/01/02");
 when(parseResult.getParamValueAsString("end-time")).thenReturn("2000/01/01");
 result = interceptor.preExecution(parseResult);
 assertThat(result.nextLine()).contains("start-time has to be earlier than end-time");
}
origin: apache/geode

 @Test
 public void testInclideStats() {
  when(parseResult.getParamValue("logs-only")).thenReturn(true);
  when(parseResult.getParamValue("stats-only")).thenReturn(false);
  result = interceptor.preExecution(parseResult);
  assertThat(result.nextLine()).isEmpty();

  when(parseResult.getParamValue("logs-only")).thenReturn(true);
  when(parseResult.getParamValue("stats-only")).thenReturn(true);
  result = interceptor.preExecution(parseResult);
  assertThat(result.nextLine()).contains("logs-only and stats-only can't both be true");
 }
}
origin: gocd/gocd

  @Test
  public void shouldNotSetConfigurationWhenArtifactIdIsNotProvided() {
    final HashMap<Object, Object> configAttrs = new HashMap<>();
    configAttrs.put(FetchPluggableArtifactTask.ARTIFACT_ID, "");
    configAttrs.put(FetchPluggableArtifactTask.CONFIGURATION, Collections.singletonMap("NAME", "gocd.zip"));

    FetchPluggableArtifactTask task = new FetchPluggableArtifactTask(new CaseInsensitiveString("#{pipeline}"), new CaseInsensitiveString("#{stage}"), new CaseInsensitiveString("#{job}"), "#{artifactId}");
    task.setFetchTaskAttributes(configAttrs);

    Assertions.assertThat(task.getArtifactId()).isEmpty();
    Assertions.assertThat(task.getConfiguration()).isEmpty();
  }
}
origin: spring-projects/spring-security

@Test
public void filterWhenDefaultClientRegistrationIdThenAuthorizedClientResolved() {
  this.function.setDefaultClientRegistrationId(this.registration.getRegistrationId());
  OAuth2RefreshToken refreshToken = new OAuth2RefreshToken("refresh-token", this.accessToken.getIssuedAt());
  OAuth2AuthorizedClient authorizedClient = new OAuth2AuthorizedClient(this.registration,
      "principalName", this.accessToken, refreshToken);
  when(this.authorizedClientRepository.loadAuthorizedClient(any(), any(), any())).thenReturn(Mono.just(authorizedClient));
  when(this.clientRegistrationRepository.findByRegistrationId(any())).thenReturn(Mono.just(this.registration));
  ClientRequest request = ClientRequest.create(GET, URI.create("https://example.com"))
      .build();
  this.function.filter(request, this.exchange).block();
  List<ClientRequest> requests = this.exchange.getRequests();
  assertThat(requests).hasSize(1);
  ClientRequest request0 = requests.get(0);
  assertThat(request0.headers().getFirst(HttpHeaders.AUTHORIZATION)).isEqualTo("Bearer token-0");
  assertThat(request0.url().toASCIIString()).isEqualTo("https://example.com");
  assertThat(request0.method()).isEqualTo(HttpMethod.GET);
  assertThat(getBody(request0)).isEmpty();
}
origin: spring-projects/spring-security

@Test
public void filterWhenClientRegistrationIdThenAuthorizedClientResolved() {
  OAuth2RefreshToken refreshToken = new OAuth2RefreshToken("refresh-token", this.accessToken.getIssuedAt());
  OAuth2AuthorizedClient authorizedClient = new OAuth2AuthorizedClient(this.registration,
      "principalName", this.accessToken, refreshToken);
  when(this.authorizedClientRepository.loadAuthorizedClient(any(), any(), any())).thenReturn(Mono.just(authorizedClient));
  when(this.clientRegistrationRepository.findByRegistrationId(any())).thenReturn(Mono.just(this.registration));
  ClientRequest request = ClientRequest.create(GET, URI.create("https://example.com"))
      .attributes(clientRegistrationId(this.registration.getRegistrationId()))
      .build();
  this.function.filter(request, this.exchange).block();
  List<ClientRequest> requests = this.exchange.getRequests();
  assertThat(requests).hasSize(1);
  ClientRequest request0 = requests.get(0);
  assertThat(request0.headers().getFirst(HttpHeaders.AUTHORIZATION)).isEqualTo("Bearer token-0");
  assertThat(request0.url().toASCIIString()).isEqualTo("https://example.com");
  assertThat(request0.method()).isEqualTo(HttpMethod.GET);
  assertThat(getBody(request0)).isEmpty();
}
origin: spring-projects/spring-security

@Test
public void filterWhenRefreshTokenNullThenShouldRefreshFalse() {
  OAuth2AuthorizedClient authorizedClient = new OAuth2AuthorizedClient(this.registration,
      "principalName", this.accessToken);
  ClientRequest request = ClientRequest.create(GET, URI.create("https://example.com"))
      .attributes(oauth2AuthorizedClient(authorizedClient))
      .build();
  this.function.filter(request, this.exchange).block();
  List<ClientRequest> requests = this.exchange.getRequests();
  assertThat(requests).hasSize(1);
  ClientRequest request0 = requests.get(0);
  assertThat(request0.headers().getFirst(HttpHeaders.AUTHORIZATION)).isEqualTo("Bearer token-0");
  assertThat(request0.url().toASCIIString()).isEqualTo("https://example.com");
  assertThat(request0.method()).isEqualTo(HttpMethod.GET);
  assertThat(getBody(request0)).isEmpty();
}
origin: spring-projects/spring-security

@Test
public void filterWhenRefreshTokenNullThenShouldRefreshFalse() {
  this.function = new ServletOAuth2AuthorizedClientExchangeFilterFunction(this.clientRegistrationRepository,
      this.authorizedClientRepository);
  OAuth2AuthorizedClient authorizedClient = new OAuth2AuthorizedClient(this.registration,
      "principalName", this.accessToken);
  ClientRequest request = ClientRequest.create(GET, URI.create("https://example.com"))
      .attributes(oauth2AuthorizedClient(authorizedClient))
      .build();
  this.function.filter(request, this.exchange).block();
  List<ClientRequest> requests = this.exchange.getRequests();
  assertThat(requests).hasSize(1);
  ClientRequest request0 = requests.get(0);
  assertThat(request0.headers().getFirst(HttpHeaders.AUTHORIZATION)).isEqualTo("Bearer token-0");
  assertThat(request0.url().toASCIIString()).isEqualTo("https://example.com");
  assertThat(request0.method()).isEqualTo(HttpMethod.GET);
  assertThat(getBody(request0)).isEmpty();
}
origin: spring-projects/spring-security

@Test
public void filterWhenNotExpiredThenShouldRefreshFalse() {
  OAuth2RefreshToken refreshToken = new OAuth2RefreshToken("refresh-token", this.accessToken.getIssuedAt());
  OAuth2AuthorizedClient authorizedClient = new OAuth2AuthorizedClient(this.registration,
      "principalName", this.accessToken, refreshToken);
  ClientRequest request = ClientRequest.create(GET, URI.create("https://example.com"))
      .attributes(oauth2AuthorizedClient(authorizedClient))
      .build();
  this.function.filter(request, this.exchange).block();
  List<ClientRequest> requests = this.exchange.getRequests();
  assertThat(requests).hasSize(1);
  ClientRequest request0 = requests.get(0);
  assertThat(request0.headers().getFirst(HttpHeaders.AUTHORIZATION)).isEqualTo("Bearer token-0");
  assertThat(request0.url().toASCIIString()).isEqualTo("https://example.com");
  assertThat(request0.method()).isEqualTo(HttpMethod.GET);
  assertThat(getBody(request0)).isEmpty();
}
origin: spring-projects/spring-session

@Test
public void onDeleteSessionCustomCookieName() throws Exception {
  setCookieName("CUSTOM");
  this.strategy.expireSession(this.request, this.response);
  assertThat(getSessionId()).isEmpty();
}
origin: spring-projects/spring-security

@Test
public void filterWhenClientCredentialsTokenNotExpiredThenUseCurrentToken() {
  this.registration = TestClientRegistrations.clientCredentials().build();
  this.function = new ServletOAuth2AuthorizedClientExchangeFilterFunction(this.clientRegistrationRepository,
      this.authorizedClientRepository);
  this.function.setClientCredentialsTokenResponseClient(this.clientCredentialsTokenResponseClient);
  OAuth2AuthorizedClient authorizedClient = new OAuth2AuthorizedClient(this.registration,
      "principalName", this.accessToken, null);
  ClientRequest request = ClientRequest.create(GET, URI.create("https://example.com"))
      .attributes(oauth2AuthorizedClient(authorizedClient))
      .attributes(authentication(this.authentication))
      .build();
  this.function.filter(request, this.exchange).block();
  verify(this.authorizedClientRepository, never()).saveAuthorizedClient(any(), eq(this.authentication), any(), any());
  verify(clientCredentialsTokenResponseClient, never()).getTokenResponse(any());
  List<ClientRequest> requests = this.exchange.getRequests();
  assertThat(requests).hasSize(1);
  ClientRequest request1 = requests.get(0);
  assertThat(request1.headers().getFirst(HttpHeaders.AUTHORIZATION)).isEqualTo("Bearer token-0");
  assertThat(request1.url().toASCIIString()).isEqualTo("https://example.com");
  assertThat(request1.method()).isEqualTo(HttpMethod.GET);
  assertThat(getBody(request1)).isEmpty();
}
origin: spring-projects/spring-security

@Test
public void filterWhenNotExpiredThenShouldRefreshFalse() {
  this.function = new ServletOAuth2AuthorizedClientExchangeFilterFunction(this.clientRegistrationRepository,
      this.authorizedClientRepository);
  OAuth2RefreshToken refreshToken = new OAuth2RefreshToken("refresh-token", this.accessToken.getIssuedAt());
  OAuth2AuthorizedClient authorizedClient = new OAuth2AuthorizedClient(this.registration,
      "principalName", this.accessToken, refreshToken);
  ClientRequest request = ClientRequest.create(GET, URI.create("https://example.com"))
      .attributes(oauth2AuthorizedClient(authorizedClient))
      .build();
  this.function.filter(request, this.exchange).block();
  List<ClientRequest> requests = this.exchange.getRequests();
  assertThat(requests).hasSize(1);
  ClientRequest request0 = requests.get(0);
  assertThat(request0.headers().getFirst(HttpHeaders.AUTHORIZATION)).isEqualTo("Bearer token-0");
  assertThat(request0.url().toASCIIString()).isEqualTo("https://example.com");
  assertThat(request0.method()).isEqualTo(HttpMethod.GET);
  assertThat(getBody(request0)).isEmpty();
}
origin: line/armeria

@Test
public void shouldReturnEchoResponse() {
  final ArmeriaReactiveWebServerFactory factory = factory();
  runEchoServer(factory, server -> {
    final HttpClient client = httpClient(server);
    validateEchoResponse(sendPostRequest(client));
    final AggregatedHttpMessage res = client.get("/hello").aggregate().join();
    assertThat(res.status()).isEqualTo(com.linecorp.armeria.common.HttpStatus.OK);
    assertThat(res.content().toStringUtf8()).isEmpty();
  });
}
org.assertj.core.apiAbstractStringAssertisEmpty

Popular methods of AbstractStringAssert

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

Popular in Java

  • Reading from database using SQL prepared statement
  • onCreateOptionsMenu (Activity)
  • onRequestPermissionsResult (Fragment)
  • compareTo (BigDecimal)
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • GridBagLayout (java.awt)
    The GridBagLayout class is a flexible layout manager that aligns components vertically and horizonta
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • ExecutorService (java.util.concurrent)
    An Executor that provides methods to manage termination and methods that can produce a Future for tr
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Best plugins for Eclipse
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