JAL-2353 primary ref candidates that should be promoted should preserve original...
[jalview.git] / test / jalview / ws / dbsources / UniprotTest.java
index a7eedf1..176cddc 100644 (file)
@@ -224,14 +224,22 @@ public class UniprotTest
     res = DBRefUtils.searchRefsForSource(seq.getDBRefs(),
             DBRefSource.UNIPROT);
     assertEquals(2, res.size());
-    res = DBRefUtils.searchRefs(seq.getDBRefs(), "AAK85932");
-    assertEquals(1, res.size());
-    assertTrue("1".equals(res.get(0).getVersion()));
     /*
      * NB this test fragile - relies on ordering being preserved
      */
     assertTrue(res.get(0).isCanonical());
     assertFalse(res.get(1).isCanonical());
+
+    // check version is preserved for EMBLCDS
+    res = DBRefUtils.searchRefs(seq.getDBRefs(), "AAK85932");
+    assertEquals(1, res.size());
+    // Ideally we would expect AAK85932.1 -> AAK85932
+    // assertTrue("1".equals(res.get(0).getVersion()));
+    // but it also passes through DBrefUtils.ensurePrimaries which adds
+    // (promoted) to the version string
+    // FIXME: Jim needs to specify what (promoted) means !! - or perhaps we just
+    // ignore it !
+    assertEquals("1 (promoted)", (res.get(0).getVersion()));
   }
 
   /**