diff options
author | Jim Hahn <jrh3@att.com> | 2021-06-29 15:17:11 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-06-29 15:17:11 +0000 |
commit | 77aa9bc1f763e4de8d0b46fefa211e6018303514 (patch) | |
tree | f0bca729dde4ac985285386c6139610aafa04199 /participant/participant-impl/participant-impl-simulator/src/test/java | |
parent | fef5b8c6cf7b5999d4ca9b3dbd65121b73076d01 (diff) | |
parent | 7f7f0c5790dc63e43a59c53154e796239ab34cbb (diff) |
Merge "Convert Intermediary Participant to Spring and refactor Participants"
Diffstat (limited to 'participant/participant-impl/participant-impl-simulator/src/test/java')
3 files changed, 5 insertions, 31 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); |