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

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

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

origin: apache/geode

 @Test
 public void toStringContainsAllVariables() {
  assertThat(value.toString()).contains(COLUMN_NAME).contains(VALUE.toString())
    .contains(DATA_TYPE.toString());
 }
}
origin: spring-projects/spring-security

@Test
public void writeInternalWhenOAuth2ErrorThenWriteErrorResponse() throws Exception {
  OAuth2Error oauth2Error = new OAuth2Error("unauthorized_client",
      "The client is not authorized", "https://tools.ietf.org/html/rfc6749#section-5.2");
  MockHttpOutputMessage outputMessage = new MockHttpOutputMessage();
  this.messageConverter.writeInternal(oauth2Error, outputMessage);
  String errorResponse = outputMessage.getBodyAsString();
  assertThat(errorResponse).contains("\"error\":\"unauthorized_client\"");
  assertThat(errorResponse).contains("\"error_description\":\"The client is not authorized\"");
  assertThat(errorResponse).contains("\"error_uri\":\"https://tools.ietf.org/html/rfc6749#section-5.2\"");
}
origin: apache/geode

@Test
public void returnsExceptionWithNoCauseForSqlException() {
 Exception sqlException = new SQLException("mySqlExceptionMessage");
 Exception e = JdbcConnectorException.createException(sqlException);
 assertThat(e.getCause()).isNull();
 assertThat(e.getMessage()).contains("mySqlExceptionMessage")
   .contains(this.getClass().getCanonicalName() + "." + testName.getMethodName());
}
origin: reactor/reactor-core

@Test
public void debugNulls() {
  logger.debug("vararg {} is {}", (Object[]) null);
  logger.debug("param {} is {}", null, null);
  assertThat(errContent.size()).isZero();
  assertThat(outContent.toString())
      .contains("vararg {} is {}")
      .contains("param null is null");
}
origin: reactor/reactor-core

@Test
public void traceNulls() {
  logger.trace("vararg {} is {}", (Object[]) null);
  logger.trace("param {} is {}", null, null);
  assertThat(errContent.size()).isZero();
  assertThat(outContent.toString())
      .contains("vararg {} is {}")
      .contains("param null is null");
}
origin: reactor/reactor-core

@Test
public void errorNulls() {
  logger.error("vararg {} is {}", (Object[]) null);
  logger.error("param {} is {}", null, null);
  assertThat(errContent.toString())
      .contains("vararg {} is {}")
      .contains("param null is null");
  assertThat(outContent.size()).isZero();
}
origin: reactor/reactor-core

@Test
public void warnNulls() {
  logger.warn("vararg {} is {}", (Object[]) null);
  logger.warn("param {} is {}", null, null);
  assertThat(errContent.toString())
      .contains("vararg {} is {}")
      .contains("param null is null");
  assertThat(outContent.size()).isZero();
}
origin: reactor/reactor-core

@Test
public void infoNulls() {
  logger.info("vararg {} is {}", (Object[]) null);
  logger.info("param {} is {}", null, null);
  assertThat(errContent.size()).isZero();
  assertThat(outContent.toString())
      .contains("vararg {} is {}")
      .contains("param null is null");
}
origin: spring-projects/spring-security

@Test
public void configureWhenAddFilterUnregisteredThenThrowsBeanCreationException() throws Exception {
  Throwable thrown = catchThrowable(() -> this.spring.register(UnregisteredFilterConfig.class).autowire() );
  assertThat(thrown).isInstanceOf(BeanCreationException.class);
  assertThat(thrown.getMessage()).contains("The Filter class " + UnregisteredFilter.class.getName() +
    " does not have a registered order and cannot be added without a specified order." +
    " Consider using addFilterBefore or addFilterAfter instead.");
}
origin: apache/geode

@Test
public void executeReturnsResultForExceptionWithoutMessage() {
 when(service.getMappingForRegion(any())).thenThrow(new NullPointerException());
 function.execute(context);
 ArgumentCaptor<CliFunctionResult> argument = ArgumentCaptor.forClass(CliFunctionResult.class);
 verify(resultSender, times(1)).lastResult(argument.capture());
 assertThat(argument.getValue().getStatusMessage())
   .contains(NullPointerException.class.getName());
}
origin: apache/geode

@Test
public void executeReturnsResultForExceptionWithoutMessage() {
 when(service.getRegionMappings()).thenThrow(new NullPointerException());
 function.execute(context);
 ArgumentCaptor<CliFunctionResult> argument = ArgumentCaptor.forClass(CliFunctionResult.class);
 verify(resultSender, times(1)).lastResult(argument.capture());
 assertThat(argument.getValue().getStatusMessage())
   .contains(NullPointerException.class.getName());
}
origin: apache/geode

 @Test
 public void executeReportsErrorIfMappingNotFound() {
  function.execute(context);

  ArgumentCaptor<CliFunctionResult> argument = ArgumentCaptor.forClass(CliFunctionResult.class);
  verify(resultSender, times(1)).lastResult(argument.capture());
  assertThat(argument.getValue().getStatusMessage())
    .contains("JDBC mapping for region \"" + regionName + "\" not found");
 }
}
origin: reactor/reactor-core

@Test
public void monoCheckpointEmpty() {
  StringWriter sw = new StringWriter();
  Mono<Object> tested = Mono.just(1)
               .map(i -> null)
               .filter(Objects::nonNull)
               .checkpoint()
               .doOnError(t -> t.printStackTrace(new PrintWriter(sw)));
  StepVerifier.create(tested)
        .verifyError();
  String debugStack = sw.toString();
  assertThat(debugStack).contains("Assembly trace from producer [reactor.core.publisher.MonoFilterFuseable] :");
}
origin: apache/geode

@Test
public void listDataSourceWithNoClusterConfigurationServerFails() {
 doReturn(null).when(command).getConfigurationPersistenceService();
 ResultModel result = command.listDataSources();
 assertThat(result.getStatus()).isEqualTo(Status.ERROR);
 assertThat(result.toString()).contains("Cluster configuration service must be enabled.");
}
origin: spring-projects/spring-security

@Test
public void cookies() {
  WebTestClient webTestClient = WebTestClient
    .bindToController(new CookieController())
    .build();
  WebDriver driver = WebTestClientHtmlUnitDriverBuilder
    .webTestClientSetup(webTestClient).build();
  driver.get("http://localhost/cookie");
  assertThat(driver.getPageSource()).contains("theCookie");
  driver.get("http://localhost/cookie/delete");
  assertThat(driver.getPageSource()).contains("null");
}
origin: spring-projects/spring-security

@Test
public void configureWhenProtectingLoginPageThenWarningLogged() {
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  redirectLogsTo(baos, DefaultFilterChainValidator.class);
  this.spring.configLocations(xml("ProtectedLoginPage")).autowire();
  assertThat(baos.toString()).contains("[WARN]");
}
origin: apache/geode

@Test
public void toStringContainsJavaVersionWhenStarting() {
 TestLauncher.TestState status = launcher.status();
 String result = status.toString();
 assertThat(result).contains(TO_STRING_PROCESS_ID);
}
origin: apache/geode

@Test
public void toStringContainsJvmArgumentsWhenStarting() {
 TestLauncher.TestState status = launcher.status();
 String result = status.toString();
 assertThat(result).contains(TO_STRING_JVM_ARGUMENTS);
}
origin: apache/geode

@Test
public void createsMappingReturnsStatusERRORWhenClusterConfigIsDisabled() {
 results.add(successFunctionResult);
 doReturn(null).when(createRegionMappingCommand).getConfigurationPersistenceService();
 ResultModel result = createRegionMappingCommand.createMapping(regionName, dataSourceName,
   tableName, pdxClass, false, null, null, null);
 assertThat(result.getStatus()).isSameAs(Result.Status.ERROR);
 assertThat(result.toString()).contains("Cluster Configuration must be enabled.");
}
origin: spring-projects/spring-security

@Test
public void helloWorld() {
  WebTestClient webTestClient = WebTestClient
    .bindToController(new HelloWorldController())
    .build();
  WebDriver driver = WebTestClientHtmlUnitDriverBuilder
    .webTestClientSetup(webTestClient).build();
  driver.get("http://localhost/");
  assertThat(driver.getPageSource()).contains("Hello World");
}
org.assertj.core.apiAbstractStringAssertcontains

Popular methods of AbstractStringAssert

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

Popular in Java

  • Start an intent from android
  • setRequestProperty (URLConnection)
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • CodeWhisperer alternatives
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