@Test
public void test100AddDeleteObject() throws Exception {
final String TEST_NAME = "test100AddDeleteObject";
TestUtil.displayTestTitle(this, TEST_NAME);
OperationResult result = new OperationResult(this.getClass().getName() + "." + TEST_NAME);
Collection<ResourceAttribute<?>> identifiers = addSampleResourceObject("john", "John", "Smith");
String uid = null;
for (ResourceAttribute<?> resourceAttribute : identifiers) {
if (SchemaConstants.ICFS_UID.equals(resourceAttribute.getElementName())) {
uid = resourceAttribute.getValue(String.class).getValue();
System.out.println("uuuuid:" + uid);
assertNotNull(uid);
}
}
ObjectClassComplexTypeDefinition accountDefinition = resourceSchema.findObjectClassDefinition(OpenDJController.OBJECT_CLASS_INETORGPERSON_NAME);
cc.deleteObject(accountDefinition, null, null, identifiers, null, result);
ResourceObjectIdentification identification = ResourceObjectIdentification.createFromAttributes(
accountDefinition, identifiers);
PrismObject<ShadowType> resObj = null;
try {
resObj = cc.fetchObject(identification, null, null,
result);
Assert.fail();
} catch (ObjectNotFoundException ex) {
AssertJUnit.assertNull(resObj);
}
}