DS-3579: Fix tests

This commit is contained in:
Tom Desair
2017-04-20 21:55:28 +02:00
parent cabb4fab66
commit a3fc30ad94
2 changed files with 5 additions and 1 deletions

View File

@@ -231,7 +231,10 @@ public class HandleServiceImpl implements HandleService
// can verify during a restore whether the same *type* of resource
// is reusing this handle!
handle.setDSpaceObject(null);
//Also remove the handle from the DSO list to keep a consistent model
dso.getHandles().remove(handle);
handleDAO.save(context, handle);
if(log.isDebugEnabled())

View File

@@ -166,9 +166,10 @@ public class VersioningTest extends AbstractUnitTest {
@Test
public void testVersionDelete() throws Exception {
context.turnOffAuthorisationSystem();
String handle = versionedItem.getHandle();
versionService.removeVersion(context, versionedItem);
assertThat("Test_version_delete", itemService.find(context, versionedItem.getID()), nullValue());
assertThat("Test_version_handle_delete", handleService.resolveToObject(context, versionedItem.getHandle()), nullValue());
assertThat("Test_version_handle_delete", handleService.resolveToObject(context, handle), nullValue());
context.restoreAuthSystemState();
}
}