Correct test to use uuids
authorCherian Mathew <c.mathew@bgbm.org>
Fri, 4 Sep 2015 09:42:17 +0000 (11:42 +0200)
committerCherian Mathew <c.mathew@bgbm.org>
Fri, 4 Sep 2015 09:42:17 +0000 (11:42 +0200)
eu.etaxonomy.taxeditor.test/src/test/java/eu/etaxonomy/taxeditor/session/CdmEntitySessionAwareTest.java

index 65445fc57b90c4dc08ea76a465c5ffe9b96c54ca..29a52b8f0ad7306d812a0b1dd1fccbc00654747d 100644 (file)
@@ -322,16 +322,8 @@ public class CdmEntitySessionAwareTest extends RemotingSessionAwareTest {
         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);
@@ -344,15 +336,9 @@ public class CdmEntitySessionAwareTest extends RemotingSessionAwareTest {
         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);
     }