Package org.springframework.security.authentication.dao

Examples of org.springframework.security.authentication.dao.ReflectionSaltSource


    //~ Methods ========================================================================================================

    @Test(expected=IllegalArgumentException.class)
    public void detectsMissingUserPropertyToUse() throws Exception {
        ReflectionSaltSource saltSource = new ReflectionSaltSource();
        saltSource.afterPropertiesSet();
    }
View Full Code Here


        saltSource.afterPropertiesSet();
    }

    @Test(expected=AuthenticationServiceException.class)
    public void exceptionIsThrownWhenInvalidPropertyRequested() throws Exception {
        ReflectionSaltSource saltSource = new ReflectionSaltSource();
        saltSource.setUserPropertyToUse("getDoesNotExist");
        saltSource.afterPropertiesSet();
        saltSource.getSalt(user);
    }
View Full Code Here

        saltSource.getSalt(user);
    }

    @Test
    public void methodNameAsPropertyToUseReturnsCorrectSaltValue() {
        ReflectionSaltSource saltSource = new ReflectionSaltSource();
        saltSource.setUserPropertyToUse("getUsername");

        assertEquals("scott", saltSource.getSalt(user));
    }
View Full Code Here

        assertEquals("scott", saltSource.getSalt(user));
    }

    @Test
    public void propertyNameAsPropertyToUseReturnsCorrectSaltValue() {
        ReflectionSaltSource saltSource = new ReflectionSaltSource();
        saltSource.setUserPropertyToUse("password");
        assertEquals("wombat", saltSource.getSalt(user));
    }
View Full Code Here

    realm = new DefaultSecurityRealm();
    realm.setConfiguration(PebbleContext.getInstance().getConfiguration());

    passwordEncoder = new PlaintextPasswordEncoder();
    realm.setPasswordEncoder(passwordEncoder);
    saltSource = new ReflectionSaltSource();
    saltSource.setUserPropertyToUse("getUsername");
    realm.setSaltSource(saltSource);

    realm.onApplicationEvent(new ContextRefreshedEvent(testApplicationContext));
  }
View Full Code Here

TOP

Related Classes of org.springframework.security.authentication.dao.ReflectionSaltSource

Copyright © 2018 www.massapicom. 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.