aboutsummaryrefslogtreecommitdiffstats
path: root/participant/participant-impl/participant-impl-simulator/src/test
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2021-06-21 16:45:27 +0100
committerFrancescoFioraEst <francesco.fiora@est.tech>2021-06-28 10:36:54 +0100
commit7f7f0c5790dc63e43a59c53154e796239ab34cbb (patch)
tree39a8682b04502e99bc8575ec636613de193ade03 /participant/participant-impl/participant-impl-simulator/src/test
parent077406d881b8b03456f76d246a4db44d13780999 (diff)
Convert Intermediary Participant to Spring and refactor Participants
Issue-ID: POLICY-3370 Change-Id: I1541fc47b35c91f9ec86ab768bc3cec2cd78647c Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'participant/participant-impl/participant-impl-simulator/src/test')
-rw-r--r--participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/controlloop/participant/simulator/endtoend/ParticipantSimulatorTest.java6
-rw-r--r--participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/controlloop/participant/simulator/main/parameters/CommonTestData.java23
-rw-r--r--participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/controlloop/participant/simulator/main/parameters/TestParticipantSimulatorParameters.java7
-rw-r--r--participant/participant-impl/participant-impl-simulator/src/test/resources/application_test.properties7
4 files changed, 5 insertions, 38 deletions
diff --git a/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/controlloop/participant/simulator/endtoend/ParticipantSimulatorTest.java b/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/controlloop/participant/simulator/endtoend/ParticipantSimulatorTest.java
index 46495f7c3..0b63c395a 100644
--- a/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/controlloop/participant/simulator/endtoend/ParticipantSimulatorTest.java
+++ b/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/controlloop/participant/simulator/endtoend/ParticipantSimulatorTest.java
@@ -40,6 +40,7 @@ import org.onap.policy.clamp.controlloop.models.messages.dmaap.participant.Parti
import org.onap.policy.clamp.controlloop.models.messages.rest.TypedSimpleResponse;
import org.onap.policy.clamp.controlloop.participant.intermediary.api.ParticipantIntermediaryApi;
import org.onap.policy.clamp.controlloop.participant.intermediary.comm.ControlLoopUpdateListener;
+import org.onap.policy.clamp.controlloop.participant.intermediary.handler.ParticipantHandler;
import org.onap.policy.clamp.controlloop.participant.simulator.main.parameters.CommonTestData;
import org.onap.policy.clamp.controlloop.participant.simulator.main.rest.AbstractRestController;
import org.onap.policy.clamp.controlloop.participant.simulator.main.rest.TestListenerUtils;
@@ -89,6 +90,9 @@ class ParticipantSimulatorTest {
@Autowired
private ParticipantIntermediaryApi participantIntermediaryApi;
+ @Autowired
+ private ParticipantHandler participantHandler;
+
private static final Object lockit = new Object();
private boolean check = false;
@@ -97,7 +101,7 @@ class ParticipantSimulatorTest {
if (!check) {
check = true;
ControlLoopUpdateListener clUpdateListener =
- new ControlLoopUpdateListener(participantIntermediaryApi.getParticipantHandler());
+ new ControlLoopUpdateListener(participantHandler);
ParticipantControlLoopUpdate participantControlLoopUpdateMsg =
TestListenerUtils.createControlLoopUpdateMsg();
diff --git a/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/controlloop/participant/simulator/main/parameters/CommonTestData.java b/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/controlloop/participant/simulator/main/parameters/CommonTestData.java
index c53410b28..e85b3ebbe 100644
--- a/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/controlloop/participant/simulator/main/parameters/CommonTestData.java
+++ b/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/controlloop/participant/simulator/main/parameters/CommonTestData.java
@@ -65,30 +65,7 @@ public class CommonTestData {
public Map<String, Object> getParticipantParameterGroupMap(final String name) {
final Map<String, Object> map = new TreeMap<>();
- map.put("name", name);
map.put("intermediaryParameters", getIntermediaryParametersMap(false));
- map.put("databaseProviderParameters", getDatabaseProviderParametersMap(false));
- return map;
- }
-
- /**
- * Returns a property map for a databaseProviderParameters map for test cases.
- *
- * @param isEmpty boolean value to represent that object created should be empty or not
- * @return a property map suitable for constructing an object
- */
- public Map<String, Object> getDatabaseProviderParametersMap(final boolean isEmpty) {
- final Map<String, Object> map = new TreeMap<>();
- if (!isEmpty) {
- map.put("name", "PolicyProviderParameterGroup");
- map.put("implementation", "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl");
- map.put("databaseDriver", "org.h2.Driver");
- map.put("databaseUrl", "jdbc:h2:mem:testdb");
- map.put("databaseUser", "policy");
- map.put("databasePassword", "P01icY");
- map.put("persistenceUnit", "ToscaConceptTest");
- }
-
return map;
}
diff --git a/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/controlloop/participant/simulator/main/parameters/TestParticipantSimulatorParameters.java b/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/controlloop/participant/simulator/main/parameters/TestParticipantSimulatorParameters.java
index e5c7b5e30..3c1d1c2a3 100644
--- a/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/controlloop/participant/simulator/main/parameters/TestParticipantSimulatorParameters.java
+++ b/participant/participant-impl/participant-impl-simulator/src/test/java/org/onap/policy/clamp/controlloop/participant/simulator/main/parameters/TestParticipantSimulatorParameters.java
@@ -47,13 +47,6 @@ class TestParticipantSimulatorParameters {
}
@Test
- void testParticipantParameterGroup_EmptyDatabaseProviderParameters() {
- final ParticipantSimulatorParameters participantParameters = commonTestData.getParticipantSimulatorParameters();
- participantParameters.setDatabaseProviderParameters(null);
- assertThat(validatorFactory.getValidator().validate(participantParameters)).isNotEmpty();
- }
-
- @Test
void testParticipantPolicyParameters_NullTopicSinks() {
final ParticipantSimulatorParameters participantParameters = commonTestData.getParticipantSimulatorParameters();
participantParameters.getIntermediaryParameters().getClampControlLoopTopics().setTopicSinks(null);
diff --git a/participant/participant-impl/participant-impl-simulator/src/test/resources/application_test.properties b/participant/participant-impl/participant-impl-simulator/src/test/resources/application_test.properties
index 89c57bb12..2b30c4ffd 100644
--- a/participant/participant-impl/participant-impl-simulator/src/test/resources/application_test.properties
+++ b/participant/participant-impl/participant-impl-simulator/src/test/resources/application_test.properties
@@ -26,10 +26,3 @@ participant.intermediaryParameters.clampControlLoopTopics.topicSinks[0].topicCom
participant.intermediaryParameters.clampControlLoopTopics.topicSinks[1].topic=POLICY-NOTIFICATION
participant.intermediaryParameters.clampControlLoopTopics.topicSinks[1].servers[0]=localhost
participant.intermediaryParameters.clampControlLoopTopics.topicSinks[1].topicCommInfrastructure=dmaap
-participant.databaseProviderParameters.name=PolicyProviderParameterGroup
-participant.databaseProviderParameters.implementation=org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl
-participant.databaseProviderParameters.databaseDriver=org.h2.Driver
-participant.databaseProviderParameters.databaseUrl=jdbc:h2:mem:testdb
-participant.databaseProviderParameters.databaseUser=policy
-participant.databaseProviderParameters.databasePassword=P01icY
-participant.databaseProviderParameters.persistenceUnit=ToscaConceptTest