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

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

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

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: gocd/gocd

@Test
public void shouldDecryptText() throws CryptoException {
  String plainText = desEncrypter.decrypt("mvcX9yrQsM4iPgm1tDxN1A==");
  assertThat(plainText).isEqualTo("user-password!");
}
origin: gocd/gocd

@Test
public void shouldDecryptEncryptedText() throws CryptoException {
  String decrypt = aesEncrypter.decrypt("AES:lzcCuNSe4vUx+CsWgN11Uw==:DelRFu6mCN7kC/2oYmeLRA==");
  assertThat(decrypt).isEqualTo("p@ssw0rd");
}
origin: spring-projects/spring-security

@Test
public void testPrintBinaryNegative() {
  assertThat(AclFormattingUtils.printBinary(0x80000000)).isEqualTo(
      "*...............................");
}
origin: spring-projects/spring-security

@Test
public void gettersReturnExpectedValues() throws Exception {
  ObjectIdentity obj = new ObjectIdentityImpl(DOMAIN_CLASS, Long.valueOf(1));
  assertThat(obj.getIdentifier()).isEqualTo(Long.valueOf(1));
  assertThat(obj.getType()).isEqualTo(MockIdDomainObject.class.getName());
}
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: gocd/gocd

@Test
public void shouldNotKillLeadingAndTrailingSpacesDuringEncryption() throws CryptoException {
  String plainText = "  \tfoobar\nbaz\t";
  String encrypt = aesEncrypter.encrypt(plainText);
  String decrypt = aesEncrypter.decrypt(encrypt);
  assertThat(decrypt).isEqualTo(plainText);
}
origin: spring-projects/spring-security

@Test
public void getAuthenticationWhenAuthenticationManagerBeanThenAuthenticates() throws Exception {
  UsernamePasswordAuthenticationToken token = new UsernamePasswordAuthenticationToken("user", "password");
  this.spring.register(AuthenticationConfiguration.class, ObjectPostProcessorConfiguration.class, AuthenticationManagerBeanConfig.class).autowire();
  AuthenticationManager authentication = this.spring.getContext().getBean(AuthenticationConfiguration.class).getAuthenticationManager();
  when(authentication.authenticate(token)).thenReturn(TestAuthentication.authenticatedUser());
  assertThat(authentication.authenticate(token).getName()).isEqualTo(token.getName());
}
origin: spring-projects/spring-security

@Test
public void getAuthenticationManagerWhenProtectedPasswordEncoderBeanThenUsed() throws Exception {
  this.spring.register(PasswordEncoderGlobalConfig.class).autowire();
  AuthenticationManager manager = this.spring.getContext()
    .getBean(AuthenticationConfiguration.class).getAuthenticationManager();
  Authentication auth = manager.authenticate(new UsernamePasswordAuthenticationToken("user", "password"));
  assertThat(auth.getName()).isEqualTo("user");
  assertThat(auth.getAuthorities()).extracting(GrantedAuthority::getAuthority).containsOnly("ROLE_USER");
}
origin: spring-projects/spring-security

@Test
public void getServiceUrlNullQuery() throws Exception {
  this.details = new DefaultServiceAuthenticationDetails(this.casServiceUrl,
      this.request, this.artifactPattern);
  assertThat(this.details.getServiceUrl())
      .isEqualTo(UrlUtils.buildFullRequestUrl(this.request));
}
origin: spring-projects/spring-security

@Test
public void getServiceUrlDoesNotUseHostHeaderExplicit() {
  this.casServiceUrl = "https://example.com/j_spring_security_cas";
  this.request.setServerName("evil.com");
  ServiceAuthenticationDetails details = loadServiceAuthenticationDetails(
      "defaultserviceauthenticationdetails-explicit.xml");
  assertThat(details.getServiceUrl())
      .isEqualTo("https://example.com/cas-sample/secure/");
}
origin: spring-projects/spring-security

@Test
public void testDetectsMissingLoginFormUrl() throws Exception {
  CasAuthenticationEntryPoint ep = new CasAuthenticationEntryPoint();
  ep.setServiceProperties(new ServiceProperties());
  try {
    ep.afterPropertiesSet();
    fail("Should have thrown IllegalArgumentException");
  }
  catch (IllegalArgumentException expected) {
    assertThat(expected.getMessage()).isEqualTo("loginUrl must be specified");
  }
}
origin: gocd/gocd

@Test
public void shouldSetConfiguration_whenPluginIsProvided() {
  final HashMap<Object, Object> configAttrs = new HashMap<>();
  configAttrs.put(FetchPluggableArtifactTask.ARTIFACT_ID, "installers");
  configAttrs.put(FetchPluggableArtifactTask.CONFIGURATION, Collections.singletonMap("NAME", "gocd.zip"));
  configAttrs.put("pluginId", "cd.go.artifact.s3");
  FetchPluggableArtifactTask task = new FetchPluggableArtifactTask(new CaseInsensitiveString("#{pipeline}"), new CaseInsensitiveString("#{stage}"), new CaseInsensitiveString("#{job}"), "#{artifactId}");
  task.setFetchTaskAttributes(configAttrs);
  Assertions.assertThat(task.getArtifactId()).isEqualTo("installers");
  Assertions.assertThat(task.getConfiguration())
      .hasSize(1)
      .contains(new ConfigurationProperty(new ConfigurationKey("NAME"), new ConfigurationValue("gocd.zip")));
}
origin: spring-projects/spring-security

@Test
public void getServiceUrlTicketOnlyParam() throws Exception {
  this.request.setQueryString("ticket=123");
  this.details = new DefaultServiceAuthenticationDetails(this.casServiceUrl,
      this.request, this.artifactPattern);
  String serviceUrl = this.details.getServiceUrl();
  this.request.setQueryString(null);
  assertThat(serviceUrl).isEqualTo(UrlUtils.buildFullRequestUrl(this.request));
}
origin: spring-projects/spring-security

@Test
public void getServiceUrlTicketFirstMultiParam() throws Exception {
  this.request.setQueryString("ticket=123&other=value");
  this.details = new DefaultServiceAuthenticationDetails(this.casServiceUrl,
      this.request, this.artifactPattern);
  String serviceUrl = this.details.getServiceUrl();
  this.request.setQueryString("other=value");
  assertThat(serviceUrl).isEqualTo(UrlUtils.buildFullRequestUrl(this.request));
}
origin: spring-projects/spring-security

@Test
public void getServiceUrlTicketMiddleMultiParam() throws Exception {
  this.request.setQueryString("other=value&ticket=123&last=this");
  this.details = new DefaultServiceAuthenticationDetails(this.casServiceUrl,
      this.request, this.artifactPattern);
  String serviceUrl = this.details.getServiceUrl();
  this.request.setQueryString("other=value&last=this");
  assertThat(serviceUrl).isEqualTo(UrlUtils.buildFullRequestUrl(this.request));
}
origin: spring-projects/spring-security

@Test
public void simpDestMatchersAnyRole() {
  messages.simpDestMatchers("admin/**", "location/**").hasAnyRole("ADMIN", "ROOT")
      .anyMessage().denyAll();
  assertThat(getAttribute()).isEqualTo("hasAnyRole('ROLE_ADMIN','ROLE_ROOT')");
}
origin: spring-projects/spring-security

@Test
public void simpDestMatchersAuthority() {
  messages.simpDestMatchers("admin/**", "location/**").hasAuthority("ROLE_ADMIN")
      .anyMessage().fullyAuthenticated();
  assertThat(getAttribute()).isEqualTo("hasAuthority('ROLE_ADMIN')");
}
origin: spring-projects/spring-security

@Test
public void simpDestMatchersAnyAuthority() {
  messages.simpDestMatchers("admin/**", "location/**")
      .hasAnyAuthority("ROLE_ADMIN", "ROLE_ROOT").anyMessage().denyAll();
  assertThat(getAttribute()).isEqualTo("hasAnyAuthority('ROLE_ADMIN','ROLE_ROOT')");
}
origin: spring-projects/spring-security

@Test
public void simpDestMessageMatchersMatch() {
  messages.simpMessageDestMatchers("location/**").denyAll().anyMessage()
      .permitAll();
  assertThat(getAttribute()).isEqualTo("denyAll");
}
org.assertj.core.apiAbstractStringAssertisEqualTo

Popular methods of AbstractStringAssert

  • contains
  • 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
  • getSystemService (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • scheduleAtFixedRate (Timer)
  • EOFException (java.io)
    Thrown when a program encounters the end of a file or stream during an input operation.
  • FileWriter (java.io)
    A specialized Writer that writes to a file in the file system. All write requests made by calling me
  • JButton (javax.swing)
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top PhpStorm plugins
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