From da53b2e97418e0e4a6522614d86179258de6bf6c Mon Sep 17 00:00:00 2001 From: liamfallon Date: Fri, 22 Apr 2022 11:10:55 +0100 Subject: Fix unit test failing due to GSON upgrade The result returned by the new GSON version has a forward slash at the end. Issue-ID: POLICY-4070 Change-Id: I218be9a3d21a78071323ae2127efa74353022800 Signed-off-by: liamfallon --- .../org/onap/policy/common/utils/resources/ResourceUtilsTest.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'utils/src/test/java') diff --git a/utils/src/test/java/org/onap/policy/common/utils/resources/ResourceUtilsTest.java b/utils/src/test/java/org/onap/policy/common/utils/resources/ResourceUtilsTest.java index 8b40816e..54e17209 100644 --- a/utils/src/test/java/org/onap/policy/common/utils/resources/ResourceUtilsTest.java +++ b/utils/src/test/java/org/onap/policy/common/utils/resources/ResourceUtilsTest.java @@ -289,7 +289,7 @@ public class ResourceUtilsTest { assertNull(ResourceUtils.getFilePath4Resource(null)); assertEquals("/something/else", ResourceUtils.getFilePath4Resource("/something/else")); assertTrue(ResourceUtils.getFilePath4Resource("xml/example.xml").endsWith("xml/example.xml")); - assertTrue(ResourceUtils.getFilePath4Resource("com/google").endsWith("com/google")); + assertTrue(ResourceUtils.getFilePath4Resource("com/google").contains("com/google")); } @Test @@ -309,7 +309,7 @@ public class ResourceUtilsTest { Set resultD2 = ResourceUtils.getDirectoryContents("org/onap/policy/common/utils/coder"); assertTrue(resultD2.size() >= 15); assertEquals("org/onap/policy/common/utils/coder/CoderExceptionTest.class", - normalizePath(resultD2.iterator().next())); + normalizePath(resultD2.iterator().next())); Set resultJ0 = ResourceUtils.getDirectoryContents("com"); assertTrue(resultJ0.contains("com/google/gson/")); @@ -326,6 +326,7 @@ public class ResourceUtilsTest { /** * Normalizes a path name, replacing OS-specific separators with "/". + * * @param pathName path name to be normalized * @return the normalized path name */ -- cgit 1.2.3-korg