Codota Logo
AbstractStringAssert.contains
Code IndexAdd Codota 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)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
SimpleDateFormat s =
  • Codota IconString pattern;new SimpleDateFormat(pattern)
  • Codota IconString template;Locale locale;new SimpleDateFormat(template, locale)
  • Codota Iconnew SimpleDateFormat()
  • Smart code suggestions by Codota
}
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 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 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 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

  • Reactive rest calls using spring rest template
  • addToBackStack (FragmentTransaction)
  • notifyDataSetChanged (ArrayAdapter)
  • getContentResolver (Context)
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Callable (java.util.concurrent)
    A task that returns a result and may throw an exception. Implementors define a single method with no
  • Notification (javax.management)
  • BoxLayout (javax.swing)
  • JComboBox (javax.swing)
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registery of org.quartz
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now