//FIXME - this is likely wrong
@Test
	public void acceptedRequestIsFullyApplied() throws EngineException
	{
		RegistrationContext defContext = new RegistrationContext(false, TriggeringMode.manualAtLogin);
		initAndCreateForm(false, null);
		RegistrationRequest request = getRequest();
		String id3 = registrationsMan.submitRegistrationRequest(request, defContext);
		registrationsMan.processRegistrationRequest(id3, null, 
				RegistrationRequestAction.accept, "a2", "p2");
		RegistrationRequestState fromDb = registrationsMan.getRegistrationRequests().get(0);
		assertEquals(request, fromDb.getRequest());
		assertEquals(2, fromDb.getAdminComments().size());
		assertEquals("p2", fromDb.getAdminComments().get(1).getContents());
		assertEquals("a2", fromDb.getAdminComments().get(0).getContents());
		assertEquals(RegistrationRequestStatus.accepted, fromDb.getStatus());
		assertEquals(id3, fromDb.getRequestId());
		assertNotNull(fromDb.getTimestamp());
		Entity added = idsMan.getEntity(new EntityParam(new IdentityTaV(X500Identity.ID, "CN=registration test")));
		assertEquals(EntityState.valid, added.getState());
		assertEquals(EngineInitialization.DEFAULT_CREDENTIAL_REQUIREMENT,
				added.getCredentialInfo().getCredentialRequirementId());
		assertThat(fromDb.getCreatedEntityId(), is(added.getId()));
		CredentialPublicInformation cpi = added.getCredentialInfo().getCredentialsState().get(
				EngineInitialization.DEFAULT_CREDENTIAL);
		assertEquals(LocalCredentialState.correct, cpi.getState());
		EntityParam addedP = new EntityParam(added.getId());
		Collection<String> groups = idsMan.getGroups(addedP).keySet();
		assertTrue(groups.contains("/"));
		assertTrue(groups.contains("/A"));
		assertTrue(groups.contains("/B"));
		Collection<AttributesClass> acs = acMan.getEntityAttributeClasses(addedP, "/");
		assertEquals(1, acs.size());
		assertEquals(InitializerCommon.NAMING_AC, acs.iterator().next().getName());
		Collection<AttributeExt> attrs = attrsMan.getAttributes(addedP, "/", "cn");
		assertEquals(1, attrs.size());
		assertEquals("val", attrs.iterator().next().getValues().get(0));
		attrs = attrsMan.getAttributes(addedP, "/", "email");
		assertEquals(1, attrs.size());
		String value = attrs.iterator().next().getValues().get(0);
		VerifiableEmail ve = new VerifiableEmail(JsonUtil.parse(value)); //FIXME - this is likely wrong
		assertEquals("foo@example.com", ve.getValue());
		assertEquals(false, ve.getConfirmationInfo().isConfirmed());
	}
assertEquals(1, attrs.size());
String value = attrs.iterator().next().getValues().get(0);
VerifiableEmail ve = new VerifiableEmail(JsonUtil.parse(value)); //FIXME - this is likely wrong
assertEquals("foo@example.com", ve.getValue());
assertEquals(false, ve.getConfirmationInfo().isConfirmed());
assertTrue(groups.contains("/B"));
Collection<AttributesClass> acs = acMan.getEntityAttributeClasses(addedP, "/");
assertEquals(1, acs.size());
assertEquals(InitializerCommon.NAMING_AC, acs.iterator().next().getName());
Collection<AttributeExt> attrs = attrsMan.getAttributes(addedP, "/", "cn");
assertEquals(1, attrs.size());
assertEquals("val", attrs.iterator().next().getValues().get(0));
attrs = attrsMan.getAttributes(addedP, "/", "email");
assertEquals(1, attrs.size());
String value = attrs.iterator().next().getValues().get(0);
VerifiableEmail ve = new VerifiableEmail(JsonUtil.parse(value)); //FIXME - this is likely wrong
assertEquals("foo@example.com", ve.getValue());
assertEquals(false, ve.getConfirmationInfo().isConfirmed());
}
assertEquals(EngineInitialization.DEFAULT_CREDENTIAL_REQUIREMENT,
added.getCredentialInfo().getCredentialRequirementId());
assertThat(fromDb.getCreatedEntityId(), is(added.getId()));
CredentialPublicInformation cpi = added.getCredentialInfo().getCredentialsState().get(
EngineInitialization.DEFAULT_CREDENTIAL);
assertEquals(LocalCredentialState.correct, cpi.getState());
EntityParam addedP = new EntityParam(added.getId());
Collection<String> groups = idsMan.getGroups(addedP).keySet();
assertTrue(groups.contains("/"));
assertTrue(groups.contains("/A"));
assertTrue(groups.contains("/B"));
Collection<AttributesClass> acs = acMan.getEntityAttributeClasses(addedP, "/");
assertEquals(1, acs.size());
assertEquals(InitializerCommon.NAMING_AC, acs.iterator().next().getName());
Collection<AttributeExt> attrs = attrsMan.getAttributes(addedP, "/", "cn");
assertEquals(1, attrs.size());
assertEquals("val", attrs.iterator().next().getValues().get(0));
attrs = attrsMan.getAttributes(addedP, "/", "email");
assertEquals(1, attrs.size());
String value = attrs.iterator().next().getValues().get(0);
VerifiableEmail ve = new VerifiableEmail(JsonUtil.parse(value)); //FIXME - this is likely wrong
assertEquals("foo@example.com", ve.getValue());
assertEquals(false, ve.getConfirmationInfo().isConfirmed());
}