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

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

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

origin: spring-projects/spring-session

  @Override
  public void doFilter(HttpServletRequest wrappedRequest) {
    assertThat(wrappedRequest.getSession().getId()).isNotEqualTo(id);
  }
});
origin: spring-projects/spring-session

  @Override
  public void doFilter(HttpServletRequest wrappedRequest) {
    HttpSession originalSession = wrappedRequest.getSession();
    assertThat(originalSession.getId()).isEqualTo(originalSessionId);
    String changeSessionId = ReflectionTestUtils.invokeMethod(wrappedRequest,
        "changeSessionId");
    assertThat(changeSessionId).isNotEqualTo(originalSessionId);
    // gh-227
    assertThat(originalSession.getId()).isEqualTo(changeSessionId);
  }
});
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 standard() throws Exception {
  CryptoAssumptions.assumeCBCJCE();
  BytesEncryptor encryptor = Encryptors.standard("password", "5c0744940b5c369b");
  byte[] result = encryptor.encrypt("text".getBytes("UTF-8"));
  assertThat(result).isNotNull();
  assertThat(new String(result).equals("text")).isFalse();
  assertThat(new String(encryptor.decrypt(result))).isEqualTo("text");
  assertThat(new String(result)).isNotEqualTo(
      new String(encryptor.encrypt("text".getBytes())));
}
origin: spring-projects/spring-security

@Test
public void stronger() throws Exception {
  CryptoAssumptions.assumeGCMJCE();
  BytesEncryptor encryptor = Encryptors.stronger("password", "5c0744940b5c369b");
  byte[] result = encryptor.encrypt("text".getBytes("UTF-8"));
  assertThat(result).isNotNull();
  assertThat(new String(result).equals("text")).isFalse();
  assertThat(new String(encryptor.decrypt(result))).isEqualTo("text");
  assertThat(new String(result)).isNotEqualTo(
      new String(encryptor.encrypt("text".getBytes())));
}
origin: spring-projects/spring-security

@Test
public void matches() {
  String result = encoder.encode("password");
  assertThat(result).isNotEqualTo("password");
  assertThat(encoder.matches("password", result)).isTrue();
}
origin: spring-projects/spring-security

ResultMatcher csrfChanged(MvcResult first) {
  return (second) -> {
    assertThat(first).isNotNull();
    assertThat(second).isNotNull();
    assertThat(first.getResponse().getContentAsString())
        .isNotEqualTo(second.getResponse().getContentAsString());
  };
}
origin: line/armeria

@Test
public void shouldBeDifferentToEachOther() throws UnsupportedEncodingException {
  final SamlRequestIdManager manager =
      SamlRequestIdManager.ofJwt("me", "test", 60, 5);
  final String id1 = manager.newId();
  final String id2 = manager.newId();
  final String id3 = manager.newId();
  assertThat(id1).isNotEqualTo(id2).isNotEqualTo(id3);
  assertThat(id2).isNotEqualTo(id3);
}
origin: spring-projects/spring-security

@Test
public void matches() {
  SCryptPasswordEncoder encoder = new SCryptPasswordEncoder();
  String result = encoder.encode("password");
  assertThat(result).isNotEqualTo("password");
  assertThat(encoder.matches("password", result)).isTrue();
}
origin: spring-projects/spring-security

@Test
public void customParameters() {
  SCryptPasswordEncoder encoder = new SCryptPasswordEncoder(512, 8, 4, 32, 16);
  String result = encoder.encode("password");
  assertThat(result).isNotEqualTo("password");
  assertThat(encoder.matches("password", result)).isTrue();
}
origin: spring-projects/spring-security

@Test
public void encodeSamePasswordMultipleTimesDiffers() {
  String password = "password";
  String encodeFirst = this.encoder.encode(password);
  String encodeSecond = this.encoder.encode(password);
  assertThat(encodeFirst).isNotEqualTo(encodeSecond);
}
origin: jdbi/jdbi

@Test
public void testToString() {
  Spiffy s1 = dbRule.getSharedHandle().attach(Spiffy.class);
  Spiffy s2 = dbRule.getSharedHandle().attach(Spiffy.class);
  assertThat(s1.toString()).isNotNull();
  assertThat(s2.toString()).isNotNull();
  assertThat(s1.toString()).isNotEqualTo(s2.toString());
}
origin: spring-projects/spring-security

@Test
public void differentPasswordHashes() {
  SCryptPasswordEncoder encoder = new SCryptPasswordEncoder();
  String password = "secret";
  assertThat(encoder.encode(password)).isNotEqualTo(encoder.encode(password));
}
origin: jdbi/jdbi

@Test
public void testArgumentWithoutToString() {
  handle.createUpdate(INSERT_POSITIONAL).bind(0, (position, statement, ctx) -> statement.setString(1, "derp")).execute();
  assertThat(positional).isNotEqualTo("derp");
}
origin: spring-projects/spring-session

private void assertNewSession() {
  Cookie cookie = getSessionCookie();
  assertThat(cookie).isNotNull();
  assertThat(cookie.getMaxAge()).isEqualTo(-1);
  assertThat(cookie.getValue()).isNotEqualTo("INVALID");
  assertThat(cookie.isHttpOnly()).describedAs("Cookie is expected to be HTTP Only")
      .isTrue();
  assertThat(cookie.getSecure())
      .describedAs(
          "Cookie secured is expected to be " + this.request.isSecure())
      .isEqualTo(this.request.isSecure());
  assertThat(this.request.getSession(false))
      .describedAs("The original HttpServletRequest HttpSession should be null")
      .isNull();
}
origin: spring-projects/spring-security

@Test
public void resolveWhenAuthorizationRequestRedirectUriTemplatedThenRedirectUriExpanded() {
  ClientRegistration clientRegistration = this.registration2;
  String requestUri = this.authorizationRequestBaseUri + "/" + clientRegistration.getRegistrationId();
  MockHttpServletRequest request = new MockHttpServletRequest("GET", requestUri);
  request.setServletPath(requestUri);
  OAuth2AuthorizationRequest authorizationRequest = this.resolver.resolve(request);
  assertThat(authorizationRequest.getRedirectUri()).isNotEqualTo(
      clientRegistration.getRedirectUriTemplate());
  assertThat(authorizationRequest.getRedirectUri()).isEqualTo(
      "http://localhost/login/oauth2/code/" + clientRegistration.getRegistrationId());
}
origin: spring-projects/spring-security

@Test
public void resolveWhenAuthorizationRequestRedirectUriTemplatedThenRedirectUriExpandedExcludesQueryString() {
  ClientRegistration clientRegistration = this.registration2;
  String requestUri = this.authorizationRequestBaseUri + "/" + clientRegistration.getRegistrationId();
  MockHttpServletRequest request = new MockHttpServletRequest("GET", requestUri);
  request.setServletPath(requestUri);
  request.setQueryString("foo=bar");
  OAuth2AuthorizationRequest authorizationRequest = this.resolver.resolve(request);
  assertThat(authorizationRequest.getRedirectUri()).isNotEqualTo(
      clientRegistration.getRedirectUriTemplate());
  assertThat(authorizationRequest.getRedirectUri()).isEqualTo(
      "http://localhost/login/oauth2/code/" + clientRegistration.getRegistrationId());
}
origin: spring-projects/spring-security

@Test
public void changeSessionIdThenPreserveParameters() throws Exception {
  MockHttpServletRequest request = new MockHttpServletRequest("GET", "");
  request.getSession();
  request.setServletPath("/login");
  request.setMethod("POST");
  request.setParameter("username", "user");
  request.setParameter("password", "password");
  request.getSession().setAttribute("attribute1", "value1");
  String id = request.getSession().getId();
  loadContext("<http>\n" + "        <form-login/>\n"
      + "        <session-management/>\n" + "        <csrf disabled='true'/>\n"
      + "    </http>" + XML_AUTHENTICATION_MANAGER);
  springSecurityFilterChain.doFilter(request, response, chain);
  assertThat(request.getSession().getId()).isNotEqualTo(id);
  assertThat(request.getSession().getAttribute("attribute1")).isEqualTo("value1");
}
origin: spring-projects/spring-security

@Test
public void changeSessionId() throws Exception {
  MockHttpServletRequest request = new MockHttpServletRequest("GET", "");
  request.getSession();
  request.setServletPath("/login");
  request.setMethod("POST");
  request.setParameter("username", "user");
  request.setParameter("password", "password");
  String id = request.getSession().getId();
  loadContext("<http>\n"
      + "        <form-login/>\n"
      + "        <session-management session-fixation-protection='changeSessionId'/>\n"
      + "        <csrf disabled='true'/>\n" + "    </http>"
      + XML_AUTHENTICATION_MANAGER);
  springSecurityFilterChain.doFilter(request, response, chain);
  assertThat(request.getSession().getId()).isNotEqualTo(id);
}
origin: spring-projects/spring-security

@Test
public void requestWhenSessionFixationProtectionIsMigrateSessionThenSessionIsReplaced()
    throws Exception {
  this.spring.configLocations(this.xml("SessionFixationProtectionMigrateSession")).autowire();
  MockHttpSession session = new MockHttpSession();
  String sessionId = session.getId();
  MvcResult result =
    this.mvc.perform(get("/auth")
        .session(session)
        .with(httpBasic("user", "password")))
        .andExpect(session())
        .andReturn();
  assertThat(result.getRequest().getSession(false).getId()).isNotEqualTo(sessionId);
}
org.assertj.core.apiAbstractStringAssertisNotEqualTo

Popular methods of AbstractStringAssert

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

Popular in Java

  • Start an intent from android
  • setRequestProperty (URLConnection)
  • onRequestPermissionsResult (Fragment)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • URLConnection (java.net)
    A connection to a URL for reading or writing. For HTTP connections, see HttpURLConnection for docume
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top plugins for Android Studio
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