Format ONAP-XACML and add JUnit
[policy/engine.git] / ONAP-XACML / src / test / java / org / onap / policy / xacml / test / std / pap / StdPDPGroupStatusTest.java
index 55413d8..5dcebcd 100644 (file)
@@ -2,7 +2,7 @@
  * ============LICENSE_START=======================================================
  * ONAP-XACML
  * ================================================================================
- * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ * Copyright (C) 2017, 2019 AT&T Intellectual Property. All rights reserved.
  * ================================================================================
  * Modifications Copyright (C) 2019 Samsung
  * ================================================================================
  * limitations under the License.
  * ============LICENSE_END=========================================================
  */
+
 package org.onap.policy.xacml.test.std.pap;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertTrue;
+
+import com.att.research.xacml.api.pap.PDP;
+import com.att.research.xacml.api.pap.PDPGroupStatus.Status;
+import com.att.research.xacml.api.pap.PDPPIPConfig;
+import com.att.research.xacml.api.pap.PDPPolicy;
+
 import java.util.HashSet;
 import java.util.Set;
+
 import org.junit.Before;
 import org.junit.Test;
 import org.onap.policy.common.logging.flexlogger.FlexLogger;
@@ -34,10 +43,6 @@ import org.onap.policy.xacml.std.pap.StdPDP;
 import org.onap.policy.xacml.std.pap.StdPDPGroupStatus;
 import org.onap.policy.xacml.std.pap.StdPDPPIPConfig;
 import org.onap.policy.xacml.std.pap.StdPDPPolicy;
-import com.att.research.xacml.api.pap.PDP;
-import com.att.research.xacml.api.pap.PDPGroupStatus.Status;
-import com.att.research.xacml.api.pap.PDPPIPConfig;
-import com.att.research.xacml.api.pap.PDPPolicy;
 
 public class StdPDPGroupStatusTest {
 
@@ -45,6 +50,9 @@ public class StdPDPGroupStatusTest {
 
     private StdPDPGroupStatus stdPDPGroupStatus;
 
+    /**
+     * setUp.
+     */
     @Before
     public void setUp() {
 
@@ -96,7 +104,9 @@ public class StdPDPGroupStatusTest {
     public void testGetLoadWarnings() {
         try {
             stdPDPGroupStatus.setLoadWarnings(new HashSet<>());
-            assertTrue(stdPDPGroupStatus.getLoadWarnings() != null);
+            assertNotNull(stdPDPGroupStatus.getLoadWarnings());
+            stdPDPGroupStatus.addLoadWarning("warn");
+            assertEquals(1, stdPDPGroupStatus.getLoadWarnings().size());
         } catch (Exception e) {
             logger.error(e);
         }
@@ -322,7 +332,6 @@ public class StdPDPGroupStatusTest {
         Set<PDP> updatingPDPs = new HashSet<>();
         updatingPDPs.add(new StdPDP());
 
-
         stdPDPGroupStatus.setStatus(status);
         stdPDPGroupStatus.setFailedPDPs(failedPDPs);
         stdPDPGroupStatus.setFailedPIPConfigs(failedPIPConfigs);