NdsBeisEsb/src/test/java/com/northgateps/nds/beis/esb/beisregistration/BeisRegistrationRouteTest.java
/**
     * This is an extremely important test since it also checks our user store's security
     * configuration is set up correctly. 
     */
This is an extremely important test since it also checks our user store's security
configuration is set up correctly.
This is an extremely important test since it also checks our user store ' s security configuration is set up correctly .
@Test
    public void testVerifyingUnactivatedUserAccountFails() throws Exception {
        assumeTrue(connection);
        MockNdsDirectoryKernel mockDirectoryKernel = new MockNdsDirectoryKernel();
        final BeisRegistrationDetails newUserDetails = registerNewUser(null);
        logger.info("Created new user, testing Unactivated User Account cannot be verified");
        String userDn = NdsDirectoryComponent.getUserDn(configurationManager,
                newUserDetails.getUserDetails().getUsername(), TENANT);
        boolean exceptionThrown = false;
        try {
            DirectoryManager directoryManager = new DirectoryManager();
            directoryManager.setKernel(mockDirectoryKernel);
            directoryManager.checkUserAndPassword(userDn, NEW_USER_PASSWORD);
        } catch (Exception e) {
            exceptionThrown = true;
        }
        assertTrue("Failed account lock test, should not be able to verify on locked account ", exceptionThrown);
    }
@ Test public void testVerifyingUnactivatedUserAccountFails ( ) throws Exception { assumeTrue ( connection ) ; MockNdsDirectoryKernel mockDirectoryKernel = new MockNdsDirectoryKernel ( ) ; final BeisRegistrationDetails newUserDetails = registerNewUser ( null ) ; logger . info ( "Created new user, testing Unactivated User Account cannot be verified" ) ; String userDn = NdsDirectoryComponent . getUserDn ( configurationManager , newUserDetails . getUserDetails ( ) . getUsername ( ) , TENANT ) ; boolean exceptionThrown = false ; try { DirectoryManager directoryManager = new DirectoryManager ( ) ; directoryManager . setKernel ( mockDirectoryKernel ) ; directoryManager . checkUserAndPassword ( userDn , NEW_USER_PASSWORD ) ; } catch ( Exception e ) { exceptionThrown = true ; } assertTrue ( "Failed account lock test, should not be able to verify on locked account " , exceptionThrown ) ; }
This is an extremely important test since it also checks our user store's security
 configuration is set up correctly.
This is an extremely important test since it also checks our user store ' s security configuration is set up correctly .
// using the standard password, check if password can be verified