public void createAndDeleteManagedObject() throws Exception {
// Given
ExternalIDRepresentation xtIDRep = createExternalIDRep(XT_ID, XT_TYPE);
ManagedObjectRepresentation moRep1 = createManagedObjectAndAssignExternalID("object1", xtIDRep);
ManagedObject retrievedMO1 = getManageObjectByExternalID(getExternalIDBoundToGId(moRep1.getId()));
retrievedMO1.delete();
// When
ManagedObjectRepresentation moRep2 = createManagedObjectAndAssignExternalID("object2", xtIDRep);
ManagedObject retrievedMO2 = getManageObjectByExternalID(getExternalIDBoundToGId(moRep2.getId()));
//Then
assertThat(retrievedMO2, is(notNullValue()));
assertThat(retrievedMO2.get().getName(), is("object2"));
//cleanup
retrievedMO2.delete();
}