summaryrefslogtreecommitdiffstats
path: root/prh-app-server/src/test/java/org
diff options
context:
space:
mode:
authorpwielebs <piotr.wielebski@nokia.com>2018-05-23 15:31:11 +0200
committerpwielebs <piotr.wielebski@nokia.com>2018-05-24 11:50:34 +0200
commit7ddaf390698fe5ae9143d91e7011059b3973f8ce (patch)
tree4d483f24c6b73ce2e0d0a8237410856f8e01edb6 /prh-app-server/src/test/java/org
parentb6bc8925a354825545b8527879e0f687b0dbab3a (diff)
Refactor of prh-aai-client
Change-Id: Idbca6fe4c050c789f4479164846437039d3b549d Issue-ID: DCAEGEN2-451 Signed-off-by: pwielebs <piotr.wielebski@nokia.com>
Diffstat (limited to 'prh-app-server/src/test/java/org')
-rw-r--r--prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImplTest.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImplTest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImplTest.java
index 41d46f66..13534ce8 100644
--- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImplTest.java
+++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/DmaapPublisherTaskImplTest.java
@@ -82,22 +82,22 @@ class DmaapPublisherTaskImplTest {
@Test
public void whenPassedObjectFits_ReturnsCorrectStatus() throws PrhTaskException {
//given
- prepareMocksForTests(HttpStatus.OK.toString());
+ prepareMocksForTests(HttpStatus.OK.value());
//when
- String response = dmaapPublisherTask.execute(consumerDmaapModel);
+ Integer response = dmaapPublisherTask.execute(consumerDmaapModel);
//then
verify(extendedDmaapProducerHttpClient, times(1))
.getHttpProducerResponse(any(ConsumerDmaapModel.class));
verifyNoMoreInteractions(extendedDmaapProducerHttpClient);
- Assertions.assertEquals(HttpStatus.OK.toString(), response);
+ Assertions.assertEquals((Integer) HttpStatus.OK.value(), response);
}
@Test
public void whenPassedObjectFits_butIncorrectResponseReturns() {
//given
- prepareMocksForTests("400");
+ prepareMocksForTests(HttpStatus.UNAUTHORIZED.value());
//when
Executable executableFunction = () -> dmaapPublisherTask.execute(consumerDmaapModel);
@@ -110,7 +110,7 @@ class DmaapPublisherTaskImplTest {
}
- private void prepareMocksForTests(String httpResponseCode) {
+ private void prepareMocksForTests(Integer httpResponseCode) {
extendedDmaapProducerHttpClient = mock(ExtendedDmaapProducerHttpClientImpl.class);
when(extendedDmaapProducerHttpClient.getHttpProducerResponse(consumerDmaapModel))
.thenReturn(Optional.of(httpResponseCode));