From cfb7e8889dc0cbf98ba5d332ee63a93db9d719da Mon Sep 17 00:00:00 2001 From: Himanshu Mantri Date: Thu, 29 Jun 2017 13:05:50 +0530 Subject: [PATCH] Changing test names and updating maven dependency --- collectionutils/pom.xml | 2 +- .../java/collectionutils/CollectionUtilsGuideTest.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/collectionutils/pom.xml b/collectionutils/pom.xml index 6d05375efe..810f53847d 100644 --- a/collectionutils/pom.xml +++ b/collectionutils/pom.xml @@ -17,7 +17,7 @@ org.apache.commons commons-collections4 - 4.0 + 4.1 diff --git a/collectionutils/src/test/java/collectionutils/CollectionUtilsGuideTest.java b/collectionutils/src/test/java/collectionutils/CollectionUtilsGuideTest.java index 0913a56c9d..af925778b8 100644 --- a/collectionutils/src/test/java/collectionutils/CollectionUtilsGuideTest.java +++ b/collectionutils/src/test/java/collectionutils/CollectionUtilsGuideTest.java @@ -35,9 +35,8 @@ public class CollectionUtilsGuideTest { @Test public void givenList_WhenAddIgnoreNull_thenNoNullAdded() { - List list = Arrays.asList("x", "y", "z"); - CollectionUtils.addIgnoreNull(list, null); - assertFalse(list.contains(null)); + CollectionUtils.addIgnoreNull(list1, null); + assertFalse(list1.contains(null)); } @Test @@ -98,14 +97,15 @@ public class CollectionUtilsGuideTest { } @Test - public void givenEmptyList_WhenCheckedIsEmpty_thenTrue() { + public void givenNonEmptyList_WhenCheckedIsNotEmpty_thenTrue() { List emptyList = new ArrayList(); List nullList = null; //Very handy at times where we want to check if a collection is not null and not empty too. //isNotEmpty does the opposite. Handy because using ! operator on isEmpty makes it missable while reading - assertTrue(CollectionUtils.isEmpty(emptyList)); + assertTrue(CollectionUtils.isNotEmpty(list1)); assertTrue(CollectionUtils.isEmpty(nullList)); + assertTrue(CollectionUtils.isEmpty(emptyList)); } @Test