X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=ONAP-XACML%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fxacml%2Ftest%2Fstd%2Fpap%2FStdPDPPIPConfigTest.java;fp=ONAP-XACML%2Fsrc%2Ftest%2Fjava%2Forg%2Fonap%2Fpolicy%2Fxacml%2Ftest%2Fstd%2Fpap%2FStdPDPPIPConfigTest.java;h=746aace3d763cd2d1ecd764ff4ece9cfca944223;hb=d089848fdb0beef8446bdcf60cdb14e4655a93e5;hp=b5713d3621e2df8cb5fc67a4ec503583fd983eca;hpb=a2ab61f0ad39970ad35c3e47ff8429f59850c469;p=policy%2Fengine.git diff --git a/ONAP-XACML/src/test/java/org/onap/policy/xacml/test/std/pap/StdPDPPIPConfigTest.java b/ONAP-XACML/src/test/java/org/onap/policy/xacml/test/std/pap/StdPDPPIPConfigTest.java index b5713d362..746aace3d 100644 --- a/ONAP-XACML/src/test/java/org/onap/policy/xacml/test/std/pap/StdPDPPIPConfigTest.java +++ b/ONAP-XACML/src/test/java/org/onap/policy/xacml/test/std/pap/StdPDPPIPConfigTest.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP-XACML * ================================================================================ - * Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. + * Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. * ================================================================================ * Modifications Copyright (C) 2019 Samsung * ================================================================================ @@ -22,14 +22,17 @@ package org.onap.policy.xacml.test.std.pap; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.CoreMatchers.not; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertThat; + import java.util.HashMap; import java.util.Map; import java.util.Properties; + import org.junit.Test; import org.onap.policy.xacml.std.pap.StdPDPPIPConfig; @@ -41,6 +44,8 @@ public class StdPDPPIPConfigTest { String value = "testVal"; Properties props = new Properties(); props.setProperty(id + ".classname", value); + props.setProperty(id + ".dontcare", "blah"); + props.setProperty("foo", "bar"); Map map = new HashMap(); map.put(id, value); @@ -106,4 +111,13 @@ public class StdPDPPIPConfigTest { // Test toString assertThat(config.toString().length(), is(not(0))); } + + @Test + public void testBadProperties() { + Properties props = new Properties(); + props.setProperty("foo", "bar"); + assertThatExceptionOfType(IllegalArgumentException.class).isThrownBy(() -> { + new StdPDPPIPConfig("myid", props); + }); + } }