Fix intermittent unit test failures reseterquestor 19/105119/1
authorliamfallon <liam.fallon@est.tech>
Sat, 4 Apr 2020 14:35:07 +0000 (15:35 +0100)
committerliamfallon <liam.fallon@est.tech>
Sun, 5 Apr 2020 12:10:18 +0000 (13:10 +0100)
commite1085f59c1ecd68de574391dc490973abd72a731
tree574cd253996b6aaec30a7b44b76fd776a70b2295
parent5e012ffd4e1c6b0d2ce174c74b939d37d5126f06
Fix intermittent unit test failures reseterquestor

When consumers and producers are paired as in the case of the REST
Rquestor, both sides must come up and be wired together in the
initiation phase of apex-pdp before the consumers and producers start
handling envents.

In the ApexActivator class, the consumers were started immediately after
they were initialized meaning that a consumer could return events to a
producer that had not started yet.

This change fixes the ApexActivator so that it waits until all consumers
and producers are initialized before starting event handling.

It also fixes the timings on RestRequestor tests and tidies up the unit
tests.

Issue-ID: POLICY-2469
Change-Id: Ib66d9531bf21f2a879ab33795aded4f48e7bfbc6
Signed-off-by: liamfallon <liam.fallon@est.tech>
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/pom.xml
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorConsumer.java
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/main/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorProducer.java
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorConsumerTest.java
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/ApexRestRequestorProducerTest.java
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RestRequestorCarrierTechnologyParametersTest.java
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/java/org/onap/policy/apex/plugins/event/carrier/restrequestor/RestRequestorTest.java
plugins/plugins-event/plugins-event-carrier/plugins-event-carrier-restrequestor/src/test/resources/logback-test.xml [new file with mode: 0644]
services/services-engine/src/main/java/org/onap/policy/apex/service/engine/main/ApexActivator.java