From: Jim Procter Date: Mon, 30 Aug 2021 10:51:00 +0000 (+0100) Subject: JAL-3863 fix test and note about fragility X-Git-Tag: Release_2_11_2_0~39^2~31 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0c021847fdf5ec9d602ed2917bbe44a461172c66;p=jalview.git JAL-3863 fix test and note about fragility --- diff --git a/test/jalview/ws/dbsources/UniprotTest.java b/test/jalview/ws/dbsources/UniprotTest.java index 31cd513..8bfaef0 100644 --- a/test/jalview/ws/dbsources/UniprotTest.java +++ b/test/jalview/ws/dbsources/UniprotTest.java @@ -27,6 +27,7 @@ import static org.testng.AssertJUnit.assertNull; import static org.testng.AssertJUnit.assertTrue; import jalview.datamodel.DBRefEntry; +import jalview.datamodel.DBRefSource; import jalview.datamodel.SequenceI; import jalview.gui.JvOptionPane; import jalview.util.DBRefUtils; @@ -225,6 +226,12 @@ public class UniprotTest List res = DBRefUtils.searchRefs(seq.getPrimaryDBRefs(), "A9CKP4"); assertEquals(1,res.size()); assertTrue(res.get(0).isCanonical()); + res = DBRefUtils.searchRefsForSource(seq.getDBRefs(), DBRefSource.UNIPROT); + assertEquals(2,res.size()); + /* + * NB this test fragile - relies on ordering being preserved + */ + assertTrue(res.get(0).isCanonical()); assertFalse(res.get(1).isCanonical()); }