Fix unit test failing due to GSON upgrade 89/128789/2
authorliamfallon <liam.fallon@est.tech>
Fri, 22 Apr 2022 10:10:55 +0000 (11:10 +0100)
committerliamfallon <liam.fallon@est.tech>
Fri, 22 Apr 2022 10:14:32 +0000 (11:14 +0100)
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 <liam.fallon@est.tech>
utils/src/test/java/org/onap/policy/common/utils/resources/ResourceUtilsTest.java

index 8b40816..54e1720 100644 (file)
@@ -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<String> 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<String> 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
      */