JAL-3863 promote non-canonical version of dbref to a canonical one
[jalview.git] / test / jalview / datamodel / DBRefEntryTest.java
index c8f998b..e95a8b5 100644 (file)
@@ -134,6 +134,21 @@ public class DBRefEntryTest
     assertEquals("3", ref1.getVersion());
 
     /*
+     * canonical == false superseded by canonical == true
+     */
+    ref1.setCanonical(false);
+    ref2.setCanonical(true);
+    assertTrue(ref1.updateFrom(ref2));
+    assertTrue(ref1.isCanonical());
+
+    /*
+     * canonical == true NOT superseded by canonical == false
+     */
+    ref1.setCanonical(true);
+    ref2.setCanonical(false);
+    assertFalse(ref1.updateFrom(ref2));
+
+    /*
      * version "source:n" with n>0 is not superseded
      */
     ref1.setVersion("UNIPROT:1");