Examples of Assertion


Examples of org.gatein.pc.test.unit.Assertion

      Set<String> names286 = jsr286a.keySet();

      for (String name286 : names286)
      {

         Assertion assertion286 = getAssertion(name286);

         Assertion related168 = assertion286.getAssertion();

         if(related168 != null)
         {
            jsr286a.get(name286).addAll(jsr168a.get(related168.name()));
         }

      }
   }
View Full Code Here

Examples of org.jasig.cas.client.validation.Assertion

  public void testParseSuccess() throws TicketValidationException, IOException {
    File file = new File(NeusoftCasTicketValidatorTest.class.getResource("/neusoft-auth-success.xml")
        .getFile());
    String response = FileUtils.readFileToString(file);
    Assertion assertion = validator.parseResponseFromServer(response);
    assertNotNull(assertion);
    assertEquals(assertion.getPrincipal().getName(), "admin");
  }
View Full Code Here

Examples of org.jasig.cas.client.validation.Assertion

    return result;
  }

  private CasAuthentication authenticateNow(CasAuthentication auth) throws AuthenticationException {
    try {
      final Assertion assertion = ticketValidator.validate(auth.getCredentials().toString(),
          auth.getLoginUrl());
      String name = assertion.getPrincipal().getName();
      final UserDetail userDetail = userDetailService.loadDetail(new UsernamePasswordAuthentication(
          name, null));
      if (null == userDetail) {
        logger.error("cannot load {}'s detail from system", name);
        throw new UsernameNotFoundException(StrUtils.concat("user ", name, " not found in system"));
View Full Code Here

Examples of org.jasig.cas.client.validation.Assertion

        cap.authenticate(token);
    }

    @Test(expected = BadCredentialsException.class)
    public void invalidKeyIsDetected() throws Exception {
        final Assertion assertion = new AssertionImpl("test");
        CasAuthenticationProvider cap = new CasAuthenticationProvider();
        cap.setAuthenticationUserDetailsService(new MockAuthoritiesPopulator());
        cap.setKey("qwerty");

        StatelessTicketCache cache = new MockStatelessTicketCache();
View Full Code Here

Examples of org.jasig.cas.client.validation.Assertion

        return result;
    }

    private CasAuthenticationToken authenticateNow(final Authentication authentication) throws AuthenticationException {
        try {
            final Assertion assertion = this.ticketValidator.validate(authentication.getCredentials().toString(), getServiceUrl(authentication));
            final UserDetails userDetails = loadUserByAssertion(assertion);
            userDetailsChecker.check(userDetails);
            return new CasAuthenticationToken(this.key, userDetails, authentication.getCredentials(),
                    authoritiesMapper.mapAuthorities(userDetails.getAuthorities()), userDetails, assertion);
        } catch (final TicketValidationException e) {
View Full Code Here

Examples of org.jasig.cas.client.validation.Assertion

    public final void setUp() throws Exception {
        super.setUp();
    }

    public void testConstructorRejectsNulls() {
        final Assertion assertion = new AssertionImpl("test");
        try {
            new CasAuthenticationToken(null, makeUserDetails(), "Password", ROLES, makeUserDetails(), assertion);
            fail("Should have thrown IllegalArgumentException");
        } catch (IllegalArgumentException expected) {
        }
View Full Code Here

Examples of org.jasig.cas.client.validation.Assertion

            assertTrue(true);
        }
    }

    public void testEqualsWhenEqual() {
        final Assertion assertion = new AssertionImpl("test");

        CasAuthenticationToken token1 = new CasAuthenticationToken("key", makeUserDetails(), "Password", ROLES,
                makeUserDetails(), assertion);

        CasAuthenticationToken token2 = new CasAuthenticationToken("key", makeUserDetails(), "Password", ROLES,
View Full Code Here

Examples of org.jasig.cas.client.validation.Assertion

        assertEquals(token1, token2);
    }

    public void testGetters() {
        // Build the proxy list returned in the ticket from CAS
        final Assertion assertion = new AssertionImpl("test");
        CasAuthenticationToken token = new CasAuthenticationToken("key", makeUserDetails(), "Password", ROLES,
                makeUserDetails(), assertion);
        assertEquals("key".hashCode(), token.getKeyHash());
        assertEquals(makeUserDetails(), token.getPrincipal());
        assertEquals("Password", token.getCredentials());
View Full Code Here

Examples of org.jasig.cas.client.validation.Assertion

            assertTrue(true);
        }
    }

    public void testNotEqualsDueToAbstractParentEqualsCheck() {
        final Assertion assertion = new AssertionImpl("test");

        CasAuthenticationToken token1 = new CasAuthenticationToken("key", makeUserDetails(), "Password", ROLES,
                makeUserDetails(), assertion);

        CasAuthenticationToken token2 = new CasAuthenticationToken("key", makeUserDetails("OTHER_NAME"), "Password",
View Full Code Here

Examples of org.jasig.cas.client.validation.Assertion

        assertTrue(!token1.equals(token2));
    }

    public void testNotEqualsDueToDifferentAuthenticationClass() {
        final Assertion assertion = new AssertionImpl("test");

        CasAuthenticationToken token1 = new CasAuthenticationToken("key", makeUserDetails(), "Password", ROLES,
                makeUserDetails(), assertion);

        UsernamePasswordAuthenticationToken token2 = new UsernamePasswordAuthenticationToken("Test", "Password", ROLES);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.