From 5b08cdeeea2f4b2702b3d1e2b2f25014423c783e Mon Sep 17 00:00:00 2001 From: Shadab Ahmad Date: Fri, 27 Sep 2024 17:40:57 +0100 Subject: [PATCH] address few more review comments --- .../java/org/uniprot/core/util/UtilsTest.java | 46 +++++++++---------- .../impl/UniParcEntryLightBuilderTest.java | 10 ++-- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/core-common/src/test/java/org/uniprot/core/util/UtilsTest.java b/core-common/src/test/java/org/uniprot/core/util/UtilsTest.java index 146d2d2f3..7b1aa24e6 100644 --- a/core-common/src/test/java/org/uniprot/core/util/UtilsTest.java +++ b/core-common/src/test/java/org/uniprot/core/util/UtilsTest.java @@ -191,26 +191,26 @@ void nonEmpty_shouldAlwaysReturnFalse() { class unmodifiableList { @Test void passingNullReturnEmptyList() { - List l = Utils.unmodifiableList(null); - assertTrue(l.isEmpty()); + List unmodifiableList = Utils.unmodifiableList(null); + assertTrue(unmodifiableList.isEmpty()); } @Test void passing_emptyList_returnEmptyList() { - List l = Utils.unmodifiableList(new ArrayList<>()); - assertTrue(l.isEmpty()); + List unmodifiableList = Utils.unmodifiableList(new ArrayList<>()); + assertTrue(unmodifiableList.isEmpty()); } @Test void passingNullReturnEmptyList_unmodifiable() { - List l = Utils.unmodifiableList(null); - assertThrows(UnsupportedOperationException.class, () -> l.add("abc")); + List unmodifiableList = Utils.unmodifiableList(null); + assertThrows(UnsupportedOperationException.class, () -> unmodifiableList.add("abc")); } @Test void passing_emptyList_returnEmptyList_unmodifiable() { - List l = Utils.unmodifiableList(new ArrayList<>()); - assertThrows(UnsupportedOperationException.class, () -> l.add("abc")); + List unmodifiableList = Utils.unmodifiableList(new ArrayList<>()); + assertThrows(UnsupportedOperationException.class, () -> unmodifiableList.add("abc")); } @Test @@ -218,8 +218,8 @@ void passingList_returnUnmodifiable() { List list = new ArrayList<>(); list.add("a"); list.add("b"); - List l = Utils.unmodifiableList(list); - assertThrows(UnsupportedOperationException.class, () -> l.add("c")); + List unmodifiableList = Utils.unmodifiableList(list); + assertThrows(UnsupportedOperationException.class, () -> unmodifiableList.add("c")); } } @@ -227,35 +227,35 @@ void passingList_returnUnmodifiable() { class unmodifiableSet { @Test void passingNullReturnEmptySet() { - Set l = Utils.unmodifiableSet(null); - assertTrue(l.isEmpty()); + Set unmodifiableSet = Utils.unmodifiableSet(null); + assertTrue(unmodifiableSet.isEmpty()); } @Test void passing_emptySet_returnEmptySet() { - Set l = Utils.unmodifiableSet(new HashSet<>()); - assertTrue(l.isEmpty()); + Set unmodifiableSet = Utils.unmodifiableSet(new HashSet<>()); + assertTrue(unmodifiableSet.isEmpty()); } @Test void passingNullReturnEmptySet_unmodifiable() { - Set l = Utils.unmodifiableSet(null); - assertThrows(UnsupportedOperationException.class, () -> l.add("abc")); + Set unmodifiableSet = Utils.unmodifiableSet(null); + assertThrows(UnsupportedOperationException.class, () -> unmodifiableSet.add("abc")); } @Test void passing_emptySet_returnEmptySet_unmodifiable() { - Set l = Utils.unmodifiableSet(new HashSet<>()); - assertThrows(UnsupportedOperationException.class, () -> l.add("abc")); + Set unmodifiableSet = Utils.unmodifiableSet(new HashSet<>()); + assertThrows(UnsupportedOperationException.class, () -> unmodifiableSet.add("abc")); } @Test void passingSet_returnUnmodifiable() { - Set list = new HashSet<>(); - list.add("a"); - list.add("b"); - Set l = Utils.unmodifiableSet(list); - assertThrows(UnsupportedOperationException.class, () -> l.add("c")); + Set set = new HashSet<>(); + set.add("a"); + set.add("b"); + Set unmodifiableSet = Utils.unmodifiableSet(set); + assertThrows(UnsupportedOperationException.class, () -> unmodifiableSet.add("c")); } @Test diff --git a/core-domain/src/test/java/org/uniprot/core/uniparc/impl/UniParcEntryLightBuilderTest.java b/core-domain/src/test/java/org/uniprot/core/uniparc/impl/UniParcEntryLightBuilderTest.java index c36e12651..d24c04bd2 100644 --- a/core-domain/src/test/java/org/uniprot/core/uniparc/impl/UniParcEntryLightBuilderTest.java +++ b/core-domain/src/test/java/org/uniprot/core/uniparc/impl/UniParcEntryLightBuilderTest.java @@ -212,17 +212,17 @@ void testGeneNamesAdd() { } @Test - void testProteomeIdsSet() { + void testProteomesSet() { LinkedHashSet proteomes = new LinkedHashSet<>(List.of(new ProteomeBuilder().id("UP000005640").component("C1").build(), new ProteomeBuilder().id("UP000002494").component("C2").build())); UniParcEntryLight entry = new UniParcEntryLightBuilder().proteomesSet(proteomes).build(); assertEquals(proteomes, entry.getProteomes()); } @Test - void testProteomeIdsAdd() { - Proteome proteomeId = new ProteomeBuilder().id("UP000005640").component("C1").build(); - UniParcEntryLight entry = new UniParcEntryLightBuilder().proteomesAdd(proteomeId).build(); - assertTrue(entry.getProteomes().contains(proteomeId)); + void testProteomeAdd() { + Proteome proteome = new ProteomeBuilder().id("UP000005640").component("C1").build(); + UniParcEntryLight entry = new UniParcEntryLightBuilder().proteomesAdd(proteome).build(); + assertTrue(entry.getProteomes().contains(proteome)); } @Test