diff options
author | Michal Kabaj <michal.kabaj@nokia.com> | 2019-12-04 12:51:19 +0100 |
---|---|---|
committer | Michal Kabaj <michal.kabaj@nokia.com> | 2019-12-04 13:18:57 +0100 |
commit | 2532f556a8bda4d6eec02d5120553262e65c7329 (patch) | |
tree | c39374d379454bf6d90256c0f5701185c259e6a0 /prh-app-server/src/test | |
parent | 26b3fd4c057a8e1ac38bcc48c920c4aef61da9e2 (diff) |
Refactor AaiClient API - remove interfaces
- Removed JsonBodyBuilder because it had only one impl - AaiJsonBodyBuilderImpl
- Removed AaiModel because it had only one impl - ConsumerDmaapModel
- Replaced usages of removed interfaces with concrete implementations
Issue-ID: DCAEGEN2-1955
Signed-off-by: Michal Kabaj <michal.kabaj@nokia.com>
Change-Id: I6cd651b2061e8520a508e3a62091d1cb15002c99
Diffstat (limited to 'prh-app-server/src/test')
-rw-r--r-- | prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AaiQueryTaskImplTest.java | 9 |
1 files changed, 5 insertions, 4 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 f2d562dc..b2702a9d 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 @@ -22,6 +22,7 @@ package org.onap.dcaegen2.services.prh.tasks; import static org.mockito.ArgumentMatchers.any; import static org.mockito.BDDMockito.given; +import static org.mockito.Mockito.mock; import java.util.Collections; import java.util.List; @@ -33,10 +34,10 @@ import org.junit.jupiter.api.extension.ExtendWith; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; import org.onap.dcaegen2.services.prh.adapter.aai.api.AaiHttpClient; -import org.onap.dcaegen2.services.prh.adapter.aai.model.AaiModel; import org.onap.dcaegen2.services.prh.adapter.aai.model.AaiServiceInstanceQueryModel; import org.onap.dcaegen2.services.prh.model.AaiPnfResultModel; import org.onap.dcaegen2.services.prh.model.AaiServiceInstanceResultModel; +import org.onap.dcaegen2.services.prh.model.ConsumerDmaapModel; import org.onap.dcaegen2.services.prh.model.ImmutableRelationshipData; import org.onap.dcaegen2.services.prh.model.Relationship; import org.onap.dcaegen2.services.prh.model.RelationshipData; @@ -46,7 +47,7 @@ import reactor.core.publisher.Mono; @ExtendWith(MockitoExtension.class) class AaiQueryTaskImplTest { @Mock - private AaiHttpClient<AaiModel, AaiPnfResultModel> getPnfModelClient; + private AaiHttpClient<ConsumerDmaapModel, AaiPnfResultModel> getPnfModelClient; @Mock private AaiHttpClient<AaiServiceInstanceQueryModel, AaiServiceInstanceResultModel> getServiceClient; @@ -67,7 +68,7 @@ class AaiQueryTaskImplTest { private AaiQueryTask sut; - private final AaiModel aaiModel = () -> "SomePNF"; + private final ConsumerDmaapModel aaiModel = mock(ConsumerDmaapModel.class); @BeforeEach void setUp() { @@ -199,7 +200,7 @@ class AaiQueryTaskImplTest { Assertions.assertTrue(task::block); } - private void configurePnfClient(final AaiModel aaiModel, final AaiPnfResultModel pnfResultModel) { + private void configurePnfClient(final ConsumerDmaapModel aaiModel, final AaiPnfResultModel pnfResultModel) { given(getPnfModelClient.getAaiResponse(aaiModel)).willReturn(Mono.just(pnfResultModel)); } } |