summaryrefslogtreecommitdiffstats
path: root/applications/common
diff options
context:
space:
mode:
Diffstat (limited to 'applications/common')
-rw-r--r--applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java12
-rw-r--r--applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProviderTest.java5
2 files changed, 12 insertions, 5 deletions
diff --git a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java
index ba562b83..465e3f58 100644
--- a/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java
+++ b/applications/common/src/main/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProvider.java
@@ -32,6 +32,7 @@ import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
@@ -55,6 +56,11 @@ import org.slf4j.LoggerFactory;
public abstract class StdXacmlApplicationServiceProvider implements XacmlApplicationServiceProvider {
private static final Logger LOGGER = LoggerFactory.getLogger(StdXacmlApplicationServiceProvider.class);
+
+ protected String applicationName = "Please Override";
+ protected List<String> actions = Collections.emptyList();
+ protected List<ToscaPolicyTypeIdentifier> supportedPolicyTypes = new ArrayList<>();
+
private Path pathForData = null;
@Getter
private RestServerParameters policyApiParameters;
@@ -68,12 +74,12 @@ public abstract class StdXacmlApplicationServiceProvider implements XacmlApplica
@Override
public String applicationName() {
- return "Please Override";
+ return applicationName;
}
@Override
public List<String> actionDecisionsSupported() {
- return Collections.emptyList();
+ return actions;
}
@Override
@@ -105,7 +111,7 @@ public abstract class StdXacmlApplicationServiceProvider implements XacmlApplica
@Override
public List<ToscaPolicyTypeIdentifier> supportedPolicyTypes() {
- throw new UnsupportedOperationException("Please override and implement supportedPolicyTypes");
+ return supportedPolicyTypes;
}
@Override
diff --git a/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProviderTest.java b/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProviderTest.java
index c95d3ca5..0552ff30 100644
--- a/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProviderTest.java
+++ b/applications/common/src/test/java/org/onap/policy/pdp/xacml/application/common/std/StdXacmlApplicationServiceProviderTest.java
@@ -20,6 +20,7 @@
package org.onap.policy.pdp.xacml.application.common.std;
+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.assertFalse;
@@ -27,7 +28,7 @@ import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
-import static org.mockito.Matchers.any;
+import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
@@ -181,7 +182,7 @@ public class StdXacmlApplicationServiceProviderTest {
@Test
public void testSupportedPolicyTypes() {
- assertThatThrownBy(() -> prov.supportedPolicyTypes()).isInstanceOf(UnsupportedOperationException.class);
+ assertThat(prov.supportedPolicyTypes()).isEmpty();
}
@Test