From 0c021847fdf5ec9d602ed2917bbe44a461172c66 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Mon, 30 Aug 2021 11:51:00 +0100 Subject: [PATCH] JAL-3863 fix test and note about fragility --- test/jalview/ws/dbsources/UniprotTest.java | 7 +++++++ 1 file changed, 7 insertions(+) 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()); } -- 1.7.10.2