summaryrefslogtreecommitdiffstats
path: root/prh-app-server/src
diff options
context:
space:
mode:
Diffstat (limited to 'prh-app-server/src')
-rw-r--r--prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasks.java4
-rw-r--r--prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasksTest.java5
2 files changed, 5 insertions, 4 deletions
diff --git a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasks.java b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasks.java
index 74c6c426..0d268003 100644
--- a/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasks.java
+++ b/prh-app-server/src/main/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasks.java
@@ -161,9 +161,7 @@ public class ScheduledTasks {
private Mono<State> publishToAaiConfiguration(final State state) {
try {
- return state.activationStatus
- ? Mono.just(state)
- : aaiProducerTask
+ return aaiProducerTask
.execute(state.dmaapModel)
.map(x -> state);
} catch (PrhTaskException e) {
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasksTest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasksTest.java
index cefc5c76..346421ec 100644
--- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasksTest.java
+++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/ScheduledTasksTest.java
@@ -139,14 +139,17 @@ class ScheduledTasksTest {
@Test
void whenPnfHasActiveService_OnlyPostToPnfUpdateShouldBePerformed() throws SSLException, PrhTaskException {
//given
+ Mono<ConsumerDmaapModel> consumerModel = Mono.just(DMAAP_MODEL);
+
given(consumer.execute()).willReturn(Flux.just(DMAAP_MODEL));
given(aaiQuery.execute(any())).willReturn(Mono.just(true));
+ given(aaiProducer.execute(DMAAP_MODEL)).willReturn(consumerModel);
//when
sut.scheduleMainPrhEventTask();
//then
- verifyThatPnfUpdateWasNotSentToAai();
+ verifyThatPnfUpdateWasSentToAai();
verifyIfLogicalLinkWasNotCreated();
verifyThatPnfModelWasNotSentDmaapPnfReadyTopic();
verifyThatPnfModelWasSentDmaapPnfUpdateTopic();