X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ONAP-PDP-REST%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fpdp%2Frest%2FPapUrlResolverTest.java;h=841fad6410ced49549e122f04d9b7aeb3d9ea28a;hb=refs%2Fchanges%2F39%2F100439%2F2;hp=fb768f7d744472ca52a763d6a4a18c8e32ece675;hpb=c8856ab39a6d8376e6ad700b6acabdc7736c714f;p=policy%2Fengine.git diff --git a/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/PapUrlResolverTest.java b/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/PapUrlResolverTest.java index fb768f7d7..841fad641 100644 --- a/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/PapUrlResolverTest.java +++ b/ONAP-PDP-REST/src/test/java/org/onap/policy/pdp/rest/PapUrlResolverTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP-PDP-REST * ================================================================================ - * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017, 2020 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Modifications Copyright (C) 2019 Samsung * ================================================================================ @@ -59,6 +59,9 @@ public class PapUrlResolverTest { succeeded = prop.getProperty(XacmlRestProperties.PROP_PAP_SUCCEEDED_URLS); rs = PapUrlResolver.getInstance(urls, failed, succeeded); Assert.assertTrue(rs.hasMoreUrls()); + Assert.assertEquals("http://one.localhost.com", rs.getUrl()); + rs.getNext(); + Assert.assertTrue(rs.hasMoreUrls()); Assert.assertEquals("http://two.localhost.com", rs.getUrl()); rs.getNext(); Assert.assertTrue(rs.hasMoreUrls()); @@ -66,9 +69,6 @@ public class PapUrlResolverTest { rs.getNext(); Assert.assertTrue(rs.hasMoreUrls()); Assert.assertEquals("http://four.localhost.com", rs.getUrl()); - rs.getNext(); - Assert.assertTrue(rs.hasMoreUrls()); - Assert.assertEquals("http://one.localhost.com", rs.getUrl()); rs.succeeded(); rs.getNext(); Assert.assertFalse(rs.hasMoreUrls()); @@ -128,13 +128,13 @@ public class PapUrlResolverTest { String succeeded = "-1,8/13/15 5:41 PM,8/13/15 4:41 PM,-1"; PapUrlResolver rs = PapUrlResolver.getInstance(urls, failed, succeeded); Assert.assertTrue(rs.hasMoreUrls()); - Assert.assertEquals("http://two.localhost.com", rs.getUrl()); + Assert.assertEquals("http://one.localhost.com", rs.getUrl()); rs.getNext(); Assert.assertTrue(rs.hasMoreUrls()); - Assert.assertEquals("http://three.localhost.com", rs.getUrl()); + Assert.assertEquals("http://two.localhost.com", rs.getUrl()); rs.getNext(); Assert.assertTrue(rs.hasMoreUrls()); - Assert.assertEquals("http://one.localhost.com", rs.getUrl()); + Assert.assertEquals("http://three.localhost.com", rs.getUrl()); rs.getNext(); Assert.assertTrue(rs.hasMoreUrls()); Assert.assertEquals("http://four.localhost.com", rs.getUrl()); @@ -186,13 +186,13 @@ public class PapUrlResolverTest { succeeded = "-1,-1,-1,-1"; rs = PapUrlResolver.getInstance(urls, failed, succeeded); Assert.assertTrue(rs.hasMoreUrls()); - Assert.assertEquals("http://two.localhost.com", rs.getUrl()); + Assert.assertEquals("http://one.localhost.com", rs.getUrl()); rs.getNext(); Assert.assertTrue(rs.hasMoreUrls()); - Assert.assertEquals("http://three.localhost.com", rs.getUrl()); + Assert.assertEquals("http://two.localhost.com", rs.getUrl()); rs.getNext(); Assert.assertTrue(rs.hasMoreUrls()); - Assert.assertEquals("http://one.localhost.com", rs.getUrl()); + Assert.assertEquals("http://three.localhost.com", rs.getUrl()); rs.getNext(); Assert.assertTrue(rs.hasMoreUrls()); Assert.assertEquals("http://four.localhost.com", rs.getUrl()); @@ -204,6 +204,9 @@ public class PapUrlResolverTest { succeeded = "-1,-1,-1,-1"; rs = PapUrlResolver.getInstance(urls, failed, succeeded); Assert.assertTrue(rs.hasMoreUrls()); + Assert.assertEquals("http://one.localhost.com", rs.getUrl()); + rs.getNext(); + Assert.assertTrue(rs.hasMoreUrls()); Assert.assertEquals("http://two.localhost.com", rs.getUrl()); rs.getNext(); Assert.assertTrue(rs.hasMoreUrls()); @@ -212,9 +215,6 @@ public class PapUrlResolverTest { Assert.assertTrue(rs.hasMoreUrls()); Assert.assertEquals("http://four.localhost.com", rs.getUrl()); rs.getNext(); - Assert.assertTrue(rs.hasMoreUrls()); - Assert.assertEquals("http://one.localhost.com", rs.getUrl()); - rs.getNext(); Assert.assertFalse(rs.hasMoreUrls()); urls = "http://one.localhost.com,http://two.localhost.com,http://three.localhost.com,http://four.localhost.com";