PolytomousKeyNode child = rootNode.getChildAt(0);
PolytomousKey subKey = child.getSubkey();
- polytomousKeyService.delete(subKey);
-
- // since subKey was not initialized before the delete, an attempt
- // to initialize it after will lead to an NPE
- try {
- PolytomousKeyNode subKeyRootNode = subKey.getRoot();
- Assert.fail("A NullPointerException indicating null root node should be thrown here");
- } catch(NullPointerException npe) {
+ polytomousKeyService.delete(subKey.getUuid());
- }
// retrieving subkey shows its null
subKey = CdmBase.deproxy(polytomousKeyService.find(subKeyUuid),PolytomousKey.class);
Assert.assertNull(subKey);
subKey = child.getSubkey();
// subkey will not be null, because the delete functionality of the subkey
// does not currently delete it from a polytomous key node
- Assert.assertNotNull(subKey);
- // after reloading the object graph, accessing subKey should throw a null pointer exception
- try {
- PolytomousKeyNode subKeyRootNode = subKey.getRoot();
- Assert.fail("A NullPointerException indicating null root node should be thrown here");
- } catch(NullPointerException npe) {
-
- }
+ // FIXME: With the new delete functionality this should be null, shouldn't it ?
+ Assert.assertNotNull(subKey);
}