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

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

Best Java code snippets using org.assertj.core.api.AbstractStringAssert (Showing top 20 results out of 2,304)

origin: gocd/gocd

@Test
public void shouldCreateAnAESCipherFileWithTheCipherIfNotFound() throws IOException, CryptoException {
  assertThat(desCipherFile.exists()).isFalse();
  assertThat(aesCipherFile.exists()).isFalse();
  GoCipher goCipher = new GoCipher(systemEnvironment);
  assertThat(desCipherFile.exists()).isFalse();
  assertThat(aesCipherFile.exists()).isTrue();
  String plainText = goCipher.decrypt(goCipher.encrypt("user-password!"));
  assertThat(plainText).isEqualTo("user-password!");
  assertThat(desCipherFile.exists()).isFalse();
  assertThat(aesCipherFile.exists()).isTrue();
}
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 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 deserializeGrantedAuthorityTest() throws IOException {
  SimpleGrantedAuthority authority = mapper.readValue(AUTHORITY_JSON, SimpleGrantedAuthority.class);
  assertThat(authority).isNotNull();
  assertThat(authority.getAuthority()).isNotNull().isEqualTo("ROLE_USER");
}
origin: reactor/reactor-core

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

@Test
public void shouldReturnBoltUrl() {
  String actual = neo4jContainer.getBoltUrl();
  assertThat(actual).isNotNull();
  assertThat(actual).startsWith("bolt://");
}
origin: reactor/reactor-core

@Test
public void stepNameAndToString() {
  AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
  MonoOnAssembly<?> test = new MonoOnAssembly<>(Mono.empty(), stacktrace);
  assertThat(test.toString())
      .isEqualTo(test.stepName())
      .startsWith("reactor.core.publisher.MonoOnAssemblyTest.stepNameAndToString(MonoOnAssemblyTest.java:");
}
origin: gocd/gocd

  @Test
  public void shouldReEncryptUsingNewKey() throws DecoderException, CryptoException {
    String originalCipherText = "mvcX9yrQsM4iPgm1tDxN1A==";
    String newCipherText = DESEncrypter.reEncryptUsingNewKey(decodeHex("269298bc31c44620"), decodeHex("02644c13cb892962"), originalCipherText);

    assertThat(originalCipherText).isNotEqualTo(newCipherText);

    DESCipherProvider newCipher = mock(DESCipherProvider.class);
    when(newCipher.getKey()).thenReturn(decodeHex("02644c13cb892962"));
    DESEncrypter newEncrypter = new DESEncrypter(newCipher);
    assertThat(newEncrypter.decrypt(newCipherText)).isEqualTo("user-password!");
  }
}
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: spring-io/initializr

private void validateHttpIeHelpContent(ResponseEntity<String> response) {
  validateContentType(response, MediaType.TEXT_PLAIN);
  assertThat(response.getHeaders().getFirst(HttpHeaders.ETAG)).isNotNull();
  assertThat(response.getBody()).contains("Spring Initializr", "Examples:", "http")
      .doesNotContain("curl");
}
origin: spring-io/initializr

private void validateCurlHelpContent(ResponseEntity<String> response) {
  validateContentType(response, MediaType.TEXT_PLAIN);
  assertThat(response.getHeaders().getFirst(HttpHeaders.ETAG)).isNotNull();
  assertThat(response.getBody()).contains("Spring Initializr", "Examples:", "curl");
}
origin: spring-projects/spring-security

@Test
public void genSaltGeneratesCorrectSaltPrefix() {
  assertThat(BCrypt.gensalt(4)).startsWith("$2a$04$");
  assertThat(BCrypt.gensalt(31)).startsWith("$2a$31$");
}
origin: jdbi/jdbi

@Test
public void testToStringDoesntAttach() {
  assertThat(onDemand.toString()).isNotNull();
  verify(mockExtensionFactory, never()).attach(any(), any());
}
origin: reactor/reactor-core

@Test
public void stacktraceHeaderTraceDescription() {
  StringBuilder sb = new StringBuilder();
  AssemblySnapshot e = new AssemblySnapshot("1234", Traces.callSiteSupplierFactory.get());
  FluxOnAssembly.fillStacktraceHeader(sb, String.class, e);
  assertThat(sb.toString())
      .startsWith("\nAssembly trace from producer [java.lang.String]")
      .endsWith(", described as [1234] :\n");
}
origin: spring-projects/spring-session

  @Override
  public void doFilter(HttpServletRequest wrappedRequest) {
    String id = wrappedRequest.getSession().getId();
    assertThat(id).isNotNull();
    assertThat(wrappedRequest.getSession().getId()).isEqualTo(id);
    SessionRepositoryFilterTests.this.request.setAttribute(ID_ATTR, id);
  }
});
origin: reactor/reactor-core

@Test
public void stepNameAndToString() {
  AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
  MonoCallableOnAssembly<?> test = new MonoCallableOnAssembly<>(Mono.empty(), stacktrace);
  assertThat(test.toString())
      .isEqualTo(test.stepName())
      .startsWith("reactor.core.publisher.MonoCallableOnAssemblyTest.stepNameAndToString(MonoCallableOnAssemblyTest.java:");
}
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-io/initializr

private void validateSpringBootHelpContent(ResponseEntity<String> response) {
  validateContentType(response, MediaType.TEXT_PLAIN);
  assertThat(response.getHeaders().getFirst(HttpHeaders.ETAG)).isNotNull();
  assertThat(response.getBody())
      .contains("Service capabilities", "Supported dependencies")
      .doesNotContain("Examples:", "curl");
}
origin: gocd/gocd

@Test
public void shouldGenerateEncryptedText() throws CryptoException {
  String encrypt = aesEncrypter.encrypt("p@ssw0rd");
  assertThat(encrypt).startsWith("AES");
  assertThat(encrypt.split(":")).hasSize(3);
}
origin: testcontainers/testcontainers-java

  @Test
  public void shouldReturnHttpUrl() {
    String actual = neo4jContainer.getHttpUrl();

    assertThat(actual).isNotNull();
    assertThat(actual).startsWith("http://");
  }
}
org.assertj.core.apiAbstractStringAssert

Most used methods

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

Popular in Java

  • Updating database using SQL prepared statement
  • getExternalFilesDir (Context)
  • getContentResolver (Context)
  • setRequestProperty (URLConnection)
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • Option (scala)
  • Github Copilot 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