aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java
diff options
context:
space:
mode:
authora.sreekumar <ajith.sreekumar@bell.ca>2022-02-07 16:05:17 +0000
committera.sreekumar <ajith.sreekumar@bell.ca>2022-02-10 10:31:15 +0000
commit873803eca00830dc3ecb61e610d90710f64a8242 (patch)
tree31531d76a87c300577da83bdf86563b78a015fce /main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java
parented116b0d61f3195a1b0ed9d38f23e494260977fd (diff)
Move PAP database provider to spring boot default
This review makes PAP talk to DB directly using the spring repositories instead of going to policy-models-provider. The models-provider methods that were just used by PAP (and not used anymore) will be removed in a different review. Also a bug identified with the usage of GeneratedValue in PfGeneratedIdKey (which is just used by PAP in statistics & audit) will also be fixed in a separate review as part of POLICY-3897. CSIT changes: https://gerrit.onap.org/r/c/policy/docker/+/127033 WIP OOM review: https://gerrit.onap.org/r/c/oom/+/127035 Change-Id: Idb13ba7eb2767cc718672b582a6518fcfc95320f Issue-ID: POLICY-3867 Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
Diffstat (limited to 'main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java')
-rw-r--r--main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java23
1 files changed, 2 insertions, 21 deletions
diff --git a/main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java b/main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java
index b77c5544..c41915d2 100644
--- a/main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java
+++ b/main/src/test/java/org/onap/policy/pap/main/parameters/TestPdpModifyRequestMapParams.java
@@ -3,6 +3,7 @@
* ONAP PAP
* ================================================================================
* Copyright (C) 2019, 2021 AT&T Intellectual Property. All rights reserved.
+ * Modifications Copyright (C) 2022 Bell Canada. All rights reserved.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -31,10 +32,8 @@ import org.junit.Test;
import org.onap.policy.common.endpoints.listeners.RequestIdDispatcher;
import org.onap.policy.models.pdp.concepts.PdpMessage;
import org.onap.policy.models.pdp.concepts.PdpStatus;
-import org.onap.policy.pap.main.PolicyModelsProviderFactoryWrapper;
import org.onap.policy.pap.main.comm.Publisher;
import org.onap.policy.pap.main.comm.TimerManager;
-import org.onap.policy.pap.main.notification.PolicyNotifier;
import org.onap.policy.pap.main.parameters.PdpModifyRequestMapParams.PdpModifyRequestMapParamsBuilder;
public class TestPdpModifyRequestMapParams {
@@ -46,8 +45,6 @@ public class TestPdpModifyRequestMapParams {
private PdpParameters pdpParams;
private TimerManager updTimers;
private TimerManager stateTimers;
- private PolicyModelsProviderFactoryWrapper dao;
- private PolicyNotifier notifier;
/**
* Sets up the objects and creates an empty {@link #builder}.
@@ -61,12 +58,10 @@ public class TestPdpModifyRequestMapParams {
pdpParams = mock(PdpParameters.class);
updTimers = mock(TimerManager.class);
stateTimers = mock(TimerManager.class);
- dao = mock(PolicyModelsProviderFactoryWrapper.class);
- notifier = mock(PolicyNotifier.class);
builder = PdpModifyRequestMapParams.builder().modifyLock(lock).pdpPublisher(pub).responseDispatcher(disp)
.params(pdpParams).stateChangeTimers(stateTimers).updateTimers(updTimers)
- .daoFactory(dao).policyNotifier(notifier).maxPdpAgeMs(MAX_PDP_AGE_MS);
+ .maxPdpAgeMs(MAX_PDP_AGE_MS);
}
@Test
@@ -79,8 +74,6 @@ public class TestPdpModifyRequestMapParams {
assertSame(pdpParams, params.getParams());
assertSame(updTimers, params.getUpdateTimers());
assertSame(stateTimers, params.getStateChangeTimers());
- assertSame(dao, params.getDaoFactory());
- assertSame(notifier, params.getPolicyNotifier());
}
@Test
@@ -133,16 +126,4 @@ public class TestPdpModifyRequestMapParams {
assertThatIllegalArgumentException().isThrownBy(() -> builder.updateTimers(null).build().validate())
.withMessageContaining("update");
}
-
- @Test
- public void testValidate_MissingDaoFactory() {
- assertThatIllegalArgumentException().isThrownBy(() -> builder.daoFactory(null).build().validate())
- .withMessageContaining("DAO");
- }
-
- @Test
- public void testValidate_MissingNotifier() {
- assertThatIllegalArgumentException().isThrownBy(() -> builder.policyNotifier(null).build().validate())
- .withMessageContaining("notifier");
- }
}