Add exclusions parameter
[policy/xacml-pdp.git] / main / src / test / java / org / onap / policy / pdpx / main / parameters / TestXacmlPdpParameterHandler.java
index 1e86fee..00e95db 100644 (file)
@@ -21,6 +21,7 @@
 
 package org.onap.policy.pdpx.main.parameters;
 
+import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
@@ -168,6 +169,20 @@ public class TestXacmlPdpParameterHandler {
                         + "\"parameters/XacmlPdpConfigParameters_InvalidRestServerParameters.json\"");
     }
 
+    @Test
+    public void testXacmlPdpParameterGroup_Exclusions() throws PolicyXacmlPdpException {
+        final String[] xacmlPdpConfigParameters = {"-c", "parameters/XacmlPdpConfigParameters_Exclusions.json"};
+
+        final XacmlPdpCommandLineArguments arguments = new XacmlPdpCommandLineArguments();
+        arguments.parse(xacmlPdpConfigParameters);
+
+        final XacmlPdpParameterGroup parGroup = new XacmlPdpParameterHandler().getParameters(arguments);
+        assertTrue(arguments.checkSetConfigurationFilePath());
+        assertEquals(CommonTestData.PDPX_PARAMETER_GROUP_NAME, parGroup.getName());
+        assertEquals(CommonTestData.PDPX_GROUP, parGroup.getPdpGroup());
+        assertThat(parGroup.getApplicationParameters().getExclusions()).hasSize(2);
+    }
+
     @Test
     public void testXacmlPdpVersion() throws PolicyXacmlPdpException {
         final String[] xacmlPdpConfigParameters = {"-v"};