Fix Junit failed after AAF version change 2.1.21 32/109532/3
authorUtkarsh Jauhari <uj426b@att.com>
Wed, 24 Jun 2020 20:49:50 +0000 (20:49 +0000)
committerUtkarsh Jauhari <uj426b@att.com>
Thu, 25 Jun 2020 00:22:10 +0000 (00:22 +0000)
Issue-ID: POLICY-2623
Signed-off-by: Utkarsh Jauhari <uj426b@att.com>
Change-Id: I86c5b6efac8f62dd0d4ba576d8ec49cfa63a58bb

policy-endpoints/src/test/java/org/onap/policy/common/endpoints/http/server/test/HttpServerTest.java

index 601c3e9..1d1568c 100644 (file)
@@ -99,9 +99,14 @@ public class HttpServerTest {
         port += 10;
     }
 
+    /**
+     * To delete temporary properties cadi_longitude,and cadi_latitude.
+     */
     @AfterClass
     public static void tearDownAfterClass() {
         HttpServletServerFactoryInstance.getServerFactory().destroy();
+        System.clearProperty("cadi_longitude");
+        System.clearProperty("cadi_latitude");
     }
 
     @Test
@@ -374,6 +379,8 @@ public class HttpServerTest {
         assertTrue(HttpServletServerFactoryInstance.getServerFactory().get(port).isAlive());
         assertEquals(1, HttpServletServerFactoryInstance.getServerFactory().inventory().size());
 
+        System.setProperty("cadi_longitude", "0.0");
+        System.setProperty("cadi_latitude", "0.0");
         server.setAafAuthentication("/*");
         assertTrue(HttpServletServerFactoryInstance.getServerFactory().get(port).isAaf());