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

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

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

origin: spring-io/initializr

private static void assertStandardErrorBody(String body, String message) {
  assertThat(body).as("error body must be available").isNotNull();
  try {
    JSONObject model = new JSONObject(body);
    assertThat(model.get("message")).isEqualTo(message);
  }
  catch (JSONException ex) {
    throw new IllegalArgumentException(ex);
  }
}
origin: apache/geode

@Test
public void oneValueWithQuotesOneWithout() {
 String cmd = "start locator --name=loc1 --J=\"-Dfoo=bar\" --J=-Dfoo=bar";
 String formattedCmd = this.formatter.formatCommand(cmd);
 String expected = "start locator --name=loc1 --J=\"-Dfoo=bar\" --J=\"-Dfoo=bar\"";
 assertThat(formattedCmd).as(cmd).isEqualTo(expected);
}
origin: reactor/reactor-core

@Test
public void syspropDebugModeShouldNotFail() {
  String operatorStacktracePropertyValue = System.getProperties().getProperty("reactor.trace.operatorStacktrace");
  assumeThat(operatorStacktracePropertyValue)
      .as("Skipping test as 'reactor.trace.operatorStacktrace' is not set to true (e.g. ran from IDE)")
      .isEqualTo("true");
  assertThat(Hooks.GLOBAL_TRACE).isTrue();
  //would throw NPE due to https://github.com/reactor/reactor-core/issues/985
  Mono.just("hello").subscribe();
}
origin: apache/geode

@Test
public void twoValuesWithQuotes() {
 String cmd = "start locator --name=loc1 --J=\"-Dfoo=bar\" --J=\"-Dfoo=bar\"";
 String formattedCmd = this.formatter.formatCommand(cmd);
 assertThat(formattedCmd).as(cmd).isEqualTo(cmd);
}
origin: apache/geode

@Test
public void optionAfterOneJOption() {
 String cmd = "start locator --name=loc1 --J=-Dfoo=bar --http-service=8080";
 String formattedCmd = this.formatter.formatCommand(cmd);
 String expected = "start locator --name=loc1 --J=\"-Dfoo=bar\" --http-service=8080";
 assertThat(formattedCmd).as(cmd).isEqualTo(expected);
}
origin: apache/geode

@Test
public void optionWithMoreThanOneHyphen() {
 String cmd = "start locator --name=loc1 --http-service-port=8080";
 String formattedCmd = this.formatter.formatCommand(cmd);
 String expected = "start locator --name=loc1 --http-service-port=8080";
 assertThat(formattedCmd).as(cmd).isEqualTo(expected);
}
origin: apache/geode

@Test // reproduces GEODE-2104
public void optionWithMoreThanOneHyphenAfterOneJOption() {
 String cmd = "start server --name=me3 --J=-Dgemfire.jmx-manager=true --http-service-port=8080";
 String formattedCmd = this.formatter.formatCommand(cmd);
 String expected =
   "start server --name=me3 --J=\"-Dgemfire.jmx-manager=true\" --http-service-port=8080";
 assertThat(formattedCmd).as(cmd).isEqualTo(expected);
}
origin: apache/geode

@Test
public void optionWithOneHyphenAfterTwoJOptions() {
 String cmd =
   "start server --name=me3 --J=-Dgemfire.jmx-manager=true --J=-Dgemfire.jmx-manager-start=true --redis-port=8080";
 String formattedCmd = this.formatter.formatCommand(cmd);
 String expected =
   "start server --name=me3 --J=\"-Dgemfire.jmx-manager=true\" --J=\"-Dgemfire.jmx-manager-start=true\" --redis-port=8080";
 assertThat(formattedCmd).as(cmd).isEqualTo(expected);
}
origin: apache/geode

@Test
public void valueContainingQuotes() {
 String cmd = "start locator --name=loc1 --J=\"-Dfoo=region\"";
 String formattedCmd = this.formatter.formatCommand(cmd);
 String expected = "start locator --name=loc1 --J=\"-Dfoo=region\"";
 assertThat(formattedCmd).as(cmd).isEqualTo(expected);
}
origin: apache/geode

@Test
public void valueContainingQuotesAndSpace() {
 String cmd = "start locator --name=loc1 --J=\"-Dfoo=my phrase\"";
 String formattedCmd = this.formatter.formatCommand(cmd);
 String expected = "start locator --name=loc1 --J=\"-Dfoo=my phrase\"";
 assertThat(formattedCmd).as(cmd).isEqualTo(expected);
}
origin: apache/geode

@Test
public void valueContainingQuotesAndMultipleSpaces() {
 String cmd = "start locator --name=loc1 --J=\"-Dfoo=this is a phrase\"";
 String formattedCmd = this.formatter.formatCommand(cmd);
 String expected = "start locator --name=loc1 --J=\"-Dfoo=this is a phrase\"";
 assertThat(formattedCmd).as(cmd).isEqualTo(expected);
}
origin: apache/geode

@Test
public void valueContainingMultipleJWithSpaces() {
 String cmd =
   "start locator --name=loc1 --J=-Dfoo=this is a phrase             --J=\"-Dfoo=a short sentence\"";
 String formattedCmd = this.formatter.formatCommand(cmd);
 String expected =
   "start locator --name=loc1 --J=\"-Dfoo=this is a phrase\" --J=\"-Dfoo=a short sentence\"";
 assertThat(formattedCmd).as(cmd).isEqualTo(expected);
}
origin: apache/geode

@Test
public void optionWithOneHyphenAfterOneJOption() {
 String cmd = "start server --name=me3 --J=-Dgemfire.jmx-manager=true --redis-port=8080";
 String formattedCmd = this.formatter.formatCommand(cmd);
 String expected =
   "start server --name=me3 --J=\"-Dgemfire.jmx-manager=true\" --redis-port=8080";
 assertThat(formattedCmd).as(cmd).isEqualTo(expected);
}
origin: apache/geode

@Test // reproduces GEODE-2104
public void optionWithMoreThanOneHyphenAfterTwoJOptions() {
 String cmd =
   "start server --name=me3 --J=-Dgemfire.jmx-manager=true --J=-Dgemfire.jmx-manager-start=true --http-service-port=8080";
 String formattedCmd = this.formatter.formatCommand(cmd);
 String expected =
   "start server --name=me3 --J=\"-Dgemfire.jmx-manager=true\" --J=\"-Dgemfire.jmx-manager-start=true\" --http-service-port=8080";
 assertThat(formattedCmd).as(cmd).isEqualTo(expected);
}
origin: spring-io/initializr

@Test
void forceSsl() {
  ResponseEntity<String> response = invokeHome("curl/1.2.4", "*/*");
  String body = response.getBody();
  assertThat(body).as("Must force https").contains("https://start.spring.io/");
  assertThat(body).as("Must force https").doesNotContain("http://");
}
origin: reactor/reactor-core

@Test
public void formatNullVararg() {
  Loggers.JdkLogger jdkLogger= new Loggers.JdkLogger(Mockito.mock(java.util.logging.Logger.class));
  assertThat(jdkLogger.format("test {} is {}", (Object[]) null))
      .as("format should be returned as is")
      .isEqualTo("test {} is {}");
}
origin: reactor/reactor-core

@Test
public void formatNullParamInVararg() {
  Loggers.JdkLogger jdkLogger= new Loggers.JdkLogger(Mockito.mock(java.util.logging.Logger.class));
  assertThat(jdkLogger.format("test {} is {}", null, null))
      .as("placeholders should be replaced by null")
      .isEqualTo("test null is null");
}
origin: reactor/reactor-core

@Test
public void formatNullFormat() {
  Loggers.JdkLogger jdkLogger = new Loggers.JdkLogger(Mockito.mock(java.util.logging.Logger.class));
  assertThat(jdkLogger.format(null, (Object[]) null))
      .as("null format should be interpreted as null")
      .isNull();
}
origin: reactor/reactor-core

@Test
public void tupleProvidesTypeSafeMethods() {
  Tuple3<String, Long, Integer> t3 = Tuples.of("string", 1L, 10);
  assertThat(t3.getT1()).as("first value is a string").isInstanceOf(String.class);
  assertThat(t3.getT2()).as("second value is a long").isInstanceOf(Long.class);
  assertThat(t3.getT3()).as("third value is an int").isInstanceOf(Integer.class);
}
origin: reactor/reactor-core

@Test
public void subscribeWithSyncFusionUpstreamFirst() {
  EmitterProcessor<String> processor = EmitterProcessor.create(16);
  StepVerifier.create(
      Mono.just("DATA")
        .subscribeWith(processor)
        .map(String::toLowerCase)
  )
        .expectNext("data")
        .expectComplete()
        .verify(Duration.ofSeconds(1));
  assertThat(processor.blockFirst()).as("later subscription").isNull();
}
org.assertj.core.apiAbstractStringAssertas

Popular methods of AbstractStringAssert

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

Popular in Java

  • Updating database using SQL prepared statement
  • notifyDataSetChanged (ArrayAdapter)
  • addToBackStack (FragmentTransaction)
  • startActivity (Activity)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • Deque (java.util)
    A linear collection that supports element insertion and removal at both ends. The name deque is shor
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Project (org.apache.tools.ant)
    Central representation of an Ant project. This class defines an Ant project with all of its targets,
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • From CI to AI: The AI layer in your organization
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