Code Review
/
policy
/
engine.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Format ONAP-XACML and add JUnit
[policy/engine.git]
/
ONAP-XACML
/
src
/
test
/
java
/
org
/
onap
/
policy
/
xacml
/
test
/
std
/
pap
/
StdPDPGroupStatusTest.java
diff --git
a/ONAP-XACML/src/test/java/org/onap/policy/xacml/test/std/pap/StdPDPGroupStatusTest.java
b/ONAP-XACML/src/test/java/org/onap/policy/xacml/test/std/pap/StdPDPGroupStatusTest.java
index
55413d8
..
5dcebcd
100644
(file)
--- a/
ONAP-XACML/src/test/java/org/onap/policy/xacml/test/std/pap/StdPDPGroupStatusTest.java
+++ b/
ONAP-XACML/src/test/java/org/onap/policy/xacml/test/std/pap/StdPDPGroupStatusTest.java
@@
-2,7
+2,7
@@
* ============LICENSE_START=======================================================
* ONAP-XACML
* ================================================================================
* ============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
* ================================================================================
* ================================================================================
* Modifications Copyright (C) 2019 Samsung
* ================================================================================
@@
-19,13
+19,22
@@
* limitations under the License.
* ============LICENSE_END=========================================================
*/
* 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;
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 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 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.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 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 {
public class StdPDPGroupStatusTest {
@@
-45,6
+50,9
@@
public class StdPDPGroupStatusTest {
private StdPDPGroupStatus stdPDPGroupStatus;
private StdPDPGroupStatus stdPDPGroupStatus;
+ /**
+ * setUp.
+ */
@Before
public void setUp() {
@Before
public void setUp() {
@@
-96,7
+104,9
@@
public class StdPDPGroupStatusTest {
public void testGetLoadWarnings() {
try {
stdPDPGroupStatus.setLoadWarnings(new HashSet<>());
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);
}
} catch (Exception e) {
logger.error(e);
}
@@
-322,7
+332,6
@@
public class StdPDPGroupStatusTest {
Set<PDP> updatingPDPs = new HashSet<>();
updatingPDPs.add(new StdPDP());
Set<PDP> updatingPDPs = new HashSet<>();
updatingPDPs.add(new StdPDP());
-
stdPDPGroupStatus.setStatus(status);
stdPDPGroupStatus.setFailedPDPs(failedPDPs);
stdPDPGroupStatus.setFailedPIPConfigs(failedPIPConfigs);
stdPDPGroupStatus.setStatus(status);
stdPDPGroupStatus.setFailedPDPs(failedPDPs);
stdPDPGroupStatus.setFailedPIPConfigs(failedPIPConfigs);