aboutsummaryrefslogtreecommitdiffstats
path: root/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTaskImplTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTaskImplTest.java')
-rw-r--r--prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTaskImplTest.java24
1 files changed, 12 insertions, 12 deletions
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTaskImplTest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTaskImplTest.java
index e81b3746..517fe73a 100644
--- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTaskImplTest.java
+++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTaskImplTest.java
@@ -3,6 +3,7 @@
* PROJECT
* ================================================================================
* Copyright (C) 2018 NOKIA Intellectual Property. All rights reserved.
+ * Copyright (C) 2023 Deutsche Telekom Intellectual Property. 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.
@@ -26,6 +27,8 @@ import static org.mockito.Mockito.mock;
import java.util.Collections;
import java.util.List;
+
+
import org.assertj.core.util.Lists;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeEach;
@@ -38,6 +41,7 @@ import org.onap.dcaegen2.services.prh.adapter.aai.api.AaiPnfResultModel;
import org.onap.dcaegen2.services.prh.adapter.aai.api.AaiServiceInstanceQueryModel;
import org.onap.dcaegen2.services.prh.adapter.aai.api.AaiServiceInstanceResultModel;
import org.onap.dcaegen2.services.prh.adapter.aai.api.ConsumerDmaapModel;
+import org.onap.dcaegen2.services.prh.adapter.aai.api.ImmutableConsumerDmaapModel;
import org.onap.dcaegen2.services.prh.model.ImmutableRelationshipData;
import org.onap.dcaegen2.services.prh.model.Relationship;
import org.onap.dcaegen2.services.prh.model.RelationshipData;
@@ -85,18 +89,6 @@ class AaiQueryTaskImplTest {
}
@Test
- void whenPnfIsUnavailable_ShouldThrowException() {
- //given
- given(getPnfModelClient.getAaiResponse(aaiModel)).willReturn(Mono.error(new Exception("404")));
-
- //when
- final Mono<Boolean> task = sut.execute(aaiModel);
-
- //then
- Assertions.assertThrows(Exception.class, task::block);
- }
-
- @Test
void whenPnfIsAvailableButRelationshipIsNull_ShouldReturnFalse() {
//given
given(pnfResultModel.getRelationshipList()).willReturn(null);
@@ -203,4 +195,12 @@ class AaiQueryTaskImplTest {
private void configurePnfClient(final ConsumerDmaapModel aaiModel, final AaiPnfResultModel pnfResultModel) {
given(getPnfModelClient.getAaiResponse(aaiModel)).willReturn(Mono.just(pnfResultModel));
}
+
+ @Test
+ void testFindPnfInAAIActive(){
+ ConsumerDmaapModel model = ImmutableConsumerDmaapModel.builder().correlationId("123").build();
+ configurePnfClient(model, pnfResultModel);
+ Mono<ConsumerDmaapModel> test = sut.findPnfinAAI(model);
+ Assertions.assertNotNull(test);
+ }
}