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

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

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

origin: spring-projects/spring-security

@Test
public void genSaltGeneratesCorrectSaltPrefix() {
  assertThat(BCrypt.gensalt(4)).startsWith("$2a$04$");
  assertThat(BCrypt.gensalt(31)).startsWith("$2a$31$");
}
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: spring-projects/spring-security

@Test
public void successIsLoggedIfAceRequiresSuccessAudit() throws Exception {
  when(ace.isAuditSuccess()).thenReturn(true);
  logger.logIfNeeded(true, ace);
  assertThat(bytes.toString()).startsWith("GRANTED due to ACE");
}
origin: reactor/reactor-core

@Test
public void debug2() throws Exception {
  logger.debug("with cause", CAUSE);
  assertThat(errContent.size()).isZero();
  assertThat(outContent.toString())
      .startsWith("[DEBUG] (" + Thread.currentThread().getName() + ") with cause - java.lang.IllegalStateException: cause" +
          "\njava.lang.IllegalStateException: cause\n" +
          "\tat reactor.util.ConsoleLoggerTest");
}
origin: reactor/reactor-core

@Test
public void info2() throws Exception {
  logger.info("with cause", CAUSE);
  assertThat(errContent.size()).isZero();
  assertThat(outContent.toString())
      .startsWith("[ INFO] (" + Thread.currentThread().getName() + ") with cause - java.lang.IllegalStateException: cause" +
          "\njava.lang.IllegalStateException: cause\n" +
          "\tat reactor.util.ConsoleLoggerTest");
}
origin: spring-projects/spring-security

  @Test
  public void failureIsLoggedIfAceRequiresFailureAudit() throws Exception {
    when(ace.isAuditFailure()).thenReturn(true);
    logger.logIfNeeded(false, ace);
    assertThat(bytes.toString()).startsWith("DENIED due to ACE");
  }
}
origin: spring-projects/spring-security

@Test
public void encodeWhenDefaultThenBCryptUsed() {
  String encodedPassword = this.encoder.encode(this.rawPassword);
  assertThat(encodedPassword).startsWith("{bcrypt}");
  assertThat(this.encoder.matches(this.rawPassword, encodedPassword)).isTrue();
}
origin: testcontainers/testcontainers-java

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

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

    assertThat(actual).isNotNull();
    assertThat(actual).startsWith("http://");
  }
}
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: 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: reactor/reactor-core

  @Test
  public void stepNameAndToString() {
    AssemblySnapshot stacktrace = new AssemblySnapshot(null, Traces.callSiteSupplierFactory.get());
    FluxCallableOnAssembly<?> test = new FluxCallableOnAssembly<>(Flux.empty(), stacktrace);

    assertThat(test.toString())
        .isEqualTo(test.stepName())
        .startsWith("reactor.core.publisher.FluxCallableOnAssemblyTest.stepNameAndToString(FluxCallableOnAssemblyTest.java:");
  }
}
origin: gocd/gocd

  @Test
  public void shouldConvertFromDESEncryptedTextToAES() throws IOException, CryptoException {
    resetCipher.setupAESCipherFile();
    resetCipher.setupDESCipherFile();

    GoCipher goCipher = new GoCipher(systemEnvironment);
    String cipherText = goCipher.desToAES("mvcX9yrQsM4iPgm1tDxN1A==");
    assertThat(cipherText).startsWith("AES:");
  }
}
origin: reactor/reactor-core

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

@Test
public void stepNameAndToString() {
  ParallelFlux<Integer> source = Flux.range(1, 4).parallel(3);
  AssemblySnapshot stacktrace = new AssemblySnapshot("foo", Traces.callSiteSupplierFactory.get());
  ParallelFluxOnAssembly<Integer> test = new ParallelFluxOnAssembly<>(source, stacktrace);
  assertThat(test.toString())
      .isEqualTo(test.stepName())
      .startsWith("reactor.core.publisher.ParallelFluxOnAssemblyTest.stepNameAndToString(ParallelFluxOnAssemblyTest.java:");
}
origin: spring-projects/spring-security

@Test
public void getTokenResponseWhenClientAuthenticationBasicThenAuthorizationHeaderIsSent() throws Exception {
  String accessTokenSuccessResponse = "{\n" +
      "	\"access_token\": \"access-token-1234\",\n" +
      "   \"token_type\": \"bearer\",\n" +
      "   \"expires_in\": \"3600\"\n" +
      "}\n";
  this.server.enqueue(jsonResponse(accessTokenSuccessResponse));
  this.tokenResponseClient.getTokenResponse(this.authorizationCodeGrantRequest());
  RecordedRequest recordedRequest = this.server.takeRequest();
  assertThat(recordedRequest.getHeader(HttpHeaders.AUTHORIZATION)).startsWith("Basic ");
}
origin: spring-projects/spring-security

@Test
public void defaultLoginPageWithSingleClientRegistrationThenRedirect() {
  this.spring.register(OAuth2LoginWithSingleClientRegistrations.class).autowire();
  WebTestClient webTestClient = WebTestClientBuilder
      .bindToWebFilters(new GitHubWebFilter(), this.springSecurity)
      .build();
  WebDriver driver = WebTestClientHtmlUnitDriverBuilder
      .webTestClientSetup(webTestClient)
      .build();
  driver.get("http://localhost/");
  assertThat(driver.getCurrentUrl()).startsWith("https://github.com/login/oauth/authorize");
}
origin: spring-projects/spring-security

@Test
public void loadConfigWhenInMemoryConfigureGlobalThenPasswordUpgraded() throws Exception {
  this.spring.register(InMemoryConfigureGlobalConfig.class).autowire();
  this.mockMvc.perform(formLogin())
      .andExpect(status().is3xxRedirection());
  UserDetailsService uds = this.spring.getContext()
      .getBean(UserDetailsService.class);
  assertThat(uds.loadUserByUsername("user").getPassword()).startsWith("{bcrypt}");
}
origin: spring-projects/spring-security

@Test
public void loadConfigWhenInMemoryConfigureProtectedThenPasswordUpgraded() throws Exception {
  this.spring.register(InMemoryConfigureProtectedConfig.class).autowire();
  this.mockMvc.perform(formLogin())
      .andExpect(status().is3xxRedirection());
  UserDetailsService uds = this.spring.getContext()
      .getBean(UserDetailsService.class);
  assertThat(uds.loadUserByUsername("user").getPassword()).startsWith("{bcrypt}");
}
origin: spring-projects/spring-security

@Test
public void passwordUpdateManagerUsed() {
  this.spring.register(MapReactiveUserDetailsServiceConfig.class).autowire();
  WebTestClient client = WebTestClientBuilder.bindToWebFilters(this.springSecurityFilterChain).build();
  client
      .get()
      .uri("/")
      .headers(h -> h.setBasicAuth("user", "password"))
      .exchange()
      .expectStatus().isOk();
  ReactiveUserDetailsService users = this.spring.getContext().getBean(ReactiveUserDetailsService.class);
  assertThat(users.findByUsername("user").block().getPassword()).startsWith("{bcrypt}");
}
org.assertj.core.apiAbstractStringAssertstartsWith

Popular methods of AbstractStringAssert

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

Popular in Java

  • Making http requests using okhttp
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • notifyDataSetChanged (ArrayAdapter)
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • NumberFormat (java.text)
    The abstract base class for all number formats. This class provides the interface for formatting and
  • Notification (javax.management)
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • Table (org.hibernate.mapping)
    A relational table
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • 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