From: liamfallon Date: Fri, 22 Apr 2022 10:10:55 +0000 (+0100) Subject: Fix unit test failing due to GSON upgrade X-Git-Tag: 1.10.3~2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F89%2F128789%2F2;p=policy%2Fcommon.git 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 --- 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 */