aboutsummaryrefslogtreecommitdiffstats
path: root/applications/optimization
diff options
context:
space:
mode:
authorPamela Dragosh <pdragosh@research.att.com>2019-11-04 16:18:08 -0500
committerPamela Dragosh <pdragosh@research.att.com>2019-11-12 18:48:04 -0500
commitfe3a8ec467beae89bca9d10b8b5b39f98c81ca01 (patch)
tree284c92033a8a504c46615ee26be6e7955938488f /applications/optimization
parent1bedb591cc68c10c7db916fda8a3f02d67c2314d (diff)
Implement closest match algorithm
Needed to add more obligations, which make it easier to scan through obligations and be able to pull information about the policy. Adding weight as an obligation for Optimization policies in order to implement "closest match" algorithm. Moved Obligation to a support class. Added JUnit code coverage on the translator classes. Split some methods up to reduce complexity via sonar. Issue-ID: POLICY-2066 Change-Id: Ibb13d2dc0a63ab2a6d585b0697a0c1d129fa8f7b Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
Diffstat (limited to 'applications/optimization')
-rw-r--r--applications/optimization/src/test/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplicationTest.java18
1 files changed, 9 insertions, 9 deletions
diff --git a/applications/optimization/src/test/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplicationTest.java b/applications/optimization/src/test/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplicationTest.java
index 1bcb5222..b77f301f 100644
--- a/applications/optimization/src/test/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplicationTest.java
+++ b/applications/optimization/src/test/java/org/onap/policy/xacml/pdp/application/optimization/OptimizationPdpApplicationTest.java
@@ -255,7 +255,7 @@ public class OptimizationPdpApplicationTest {
//
DecisionResponse response = makeDecision();
assertThat(response).isNotNull();
- assertThat(response.getPolicies().size()).isEqualTo(3); // Should be 1
+ assertThat(response.getPolicies().size()).isEqualTo(2);
//
// Validate it
//
@@ -275,7 +275,7 @@ public class OptimizationPdpApplicationTest {
DecisionResponse response = makeDecision();
assertThat(response).isNotNull();
- assertThat(response.getPolicies().size()).isEqualTo(6); // should be 1
+ assertThat(response.getPolicies().size()).isEqualTo(4);
//
// Validate it
//
@@ -286,7 +286,7 @@ public class OptimizationPdpApplicationTest {
@Test
public void test07OptimizationDefaultGeographyAndServiceAndResource() throws CoderException {
//
- // Add vCPE to the service list
+ // Add vG to the resource list
//
((List<String>)baseRequest.getResource().get("resources")).add("vG");
//
@@ -295,7 +295,7 @@ public class OptimizationPdpApplicationTest {
DecisionResponse response = makeDecision();
assertThat(response).isNotNull();
- assertThat(response.getPolicies().size()).isEqualTo(11); // should be 4
+ assertThat(response.getPolicies().size()).isEqualTo(8);
//
// Validate it
//
@@ -315,7 +315,7 @@ public class OptimizationPdpApplicationTest {
DecisionResponse response = makeDecision();
assertThat(response).isNotNull();
- assertThat(response.getPolicies().size()).isEqualTo(12); // should be 1
+ assertThat(response.getPolicies().size()).isEqualTo(8);
//
// Validate it
//
@@ -335,7 +335,7 @@ public class OptimizationPdpApplicationTest {
DecisionResponse response = makeDecision();
assertThat(response).isNotNull();
- assertThat(response.getPolicies().size()).isEqualTo(14); // should be 3
+ assertThat(response.getPolicies().size()).isEqualTo(10);
//
// Validate it
//
@@ -355,7 +355,7 @@ public class OptimizationPdpApplicationTest {
DecisionResponse response = makeDecision();
assertThat(response).isNotNull();
- assertThat(response.getPolicies().size()).isEqualTo(13); // should be 2
+ assertThat(response.getPolicies().size()).isEqualTo(9);
//
// Validate it
//
@@ -375,7 +375,7 @@ public class OptimizationPdpApplicationTest {
DecisionResponse response = makeDecision();
assertThat(response).isNotNull();
- assertThat(response.getPolicies().size()).isEqualTo(4); // should be 1
+ assertThat(response.getPolicies().size()).isEqualTo(1);
//
// Validate it
//
@@ -395,7 +395,7 @@ public class OptimizationPdpApplicationTest {
DecisionResponse response = makeDecision();
assertThat(response).isNotNull();
- assertThat(response.getPolicies().size()).isEqualTo(6); // should be 2
+ assertThat(response.getPolicies().size()).isEqualTo(2);
//
// Validate it
//