* ============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;
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 {
private StdPDPGroupStatus stdPDPGroupStatus;
+ /**
+ * setUp.
+ */
@Before
public void setUp() {
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);
}
Set<PDP> updatingPDPs = new HashSet<>();
updatingPDPs.add(new StdPDP());
-
stdPDPGroupStatus.setStatus(status);
stdPDPGroupStatus.setFailedPDPs(failedPDPs);
stdPDPGroupStatus.setFailedPIPConfigs(failedPIPConfigs);