assertTrue("Failure the Users keyrecovery session should have been unmarked", !keyrecsession.isUserMarked(admin,username));
assertTrue("Failure the users keyrecovery session should have been unmarked", !keyrecsession.isUserMarked(admin,username));
    public void test05UnmarkKeyRecoveryOnFinish() throws Exception {    	log.debug(">test05UnmarkKeyRecoveryOnFinish()");    	    	GlobalConfiguration config = raadminsession.loadGlobalConfiguration(admin);    	boolean orgkeyrecconfig = config.getEnableKeyRecovery();    	config.setEnableKeyRecovery(true);    	raadminsession.saveGlobalConfiguration(admin,config);    	        // create certificate for user        //    	 Set status to NEW                usersession.setPassword(admin, username, "foo123");        usersession.setUserStatus(admin, username, UserDataConstants.STATUS_NEW);            	            	// Create a dummy certificate and keypair.    	KeyPair keys = KeyTools.genKeys(1024);        ISignSessionHome home = (ISignSessionHome) javax.rmi.PortableRemoteObject.narrow(getInitialContext().lookup("RSASignSession"), ISignSessionHome.class);        ISignSessionRemote ss = home.create();    	X509Certificate cert = (X509Certificate) ss.createCertificate(admin,username,"foo123",keys.getPublic());     	    	// First mark the user for recovery    	keyrecsession.addKeyRecoveryData(admin, cert, username, keys);		keyrecsession.markNewestAsRecoverable(admin,username);    	    	// Now finish the user (The actual test)		remote.finishUser(admin,username,pwd);		// And se if the user is still marked				assertTrue("Failure the Users keyrecovery session should have been unmarked", !keyrecsession.isUserMarked(admin,username));				// Clean up		keyrecsession.removeAllKeyRecoveryData(admin,username);				config.setEnableKeyRecovery(orgkeyrecconfig);    	raadminsession.saveGlobalConfiguration(admin,config);    	log.debug("<test05UnmarkKeyRecoveryOnFinish()");    }