summaryrefslogtreecommitdiffstats
path: root/prh-dmaap-client/src/test/java
diff options
context:
space:
mode:
authorpwielebs <piotr.wielebski@nokia.com>2018-04-30 17:15:58 +0200
committerpwielebs <piotr.wielebski@nokia.com>2018-04-30 17:16:59 +0200
commitb1c5d01900ea67f1ed27b4f66020912a0b29aa37 (patch)
tree1f97f4fba492e3c44cf5c20ab27271efc7a1936d /prh-dmaap-client/src/test/java
parentbf6fa5deff9190c14bba2b15271e44f1e3c21ee7 (diff)
Response handlers for DmaaP clients changed
Change-Id: I625521013aa02e6709be95ad7b3443707a549f05 Issue-ID: DCAEGEN2-451 Signed-off-by: pwielebs <piotr.wielebski@nokia.com>
Diffstat (limited to 'prh-dmaap-client/src/test/java')
-rw-r--r--prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/service/producer/ExtendedDmaapProducerHttpClientImplTest.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/service/producer/ExtendedDmaapProducerHttpClientImplTest.java b/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/service/producer/ExtendedDmaapProducerHttpClientImplTest.java
index 67c58f55..0560432b 100644
--- a/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/service/producer/ExtendedDmaapProducerHttpClientImplTest.java
+++ b/prh-dmaap-client/src/test/java/org/onap/dcaegen2/services/service/producer/ExtendedDmaapProducerHttpClientImplTest.java
@@ -47,6 +47,8 @@ public class ExtendedDmaapProducerHttpClientImplTest {
private static Optional<String> expectedResult = Optional.empty();
private static final String JSON_MESSAGE = "{ \"ipaddress-v4-oam\": \"11.22.33.44\" }";
+ private static final String RESPONSE_SUCCESS = "200";
+ private static final String RESPONSE_FAILURE = "404";
@BeforeAll
public static void init() throws NoSuchFieldException, IllegalAccessException {
@@ -70,7 +72,7 @@ public class ExtendedDmaapProducerHttpClientImplTest {
@Test
public void getHttpResponsePost_success() throws IOException {
- expectedResult = Optional.of(JSON_MESSAGE);
+ expectedResult = Optional.of(RESPONSE_SUCCESS);
when(closeableHttpClientMock.execute(any(HttpPost.class), any(ResponseHandler.class)))
.thenReturn(expectedResult);
@@ -81,8 +83,8 @@ public class ExtendedDmaapProducerHttpClientImplTest {
}
@Test
- public void getExtendedDetails_returnsNull() throws IOException {
- expectedResult = Optional.of(JSON_MESSAGE);
+ public void getExtendedDetails_returnsFailure() throws IOException {
+ expectedResult = Optional.of(RESPONSE_FAILURE);
when(closeableHttpClientMock.execute(any(HttpPost.class), any(ResponseHandler.class))).
thenReturn(Optional.empty());
Optional<String> actualResult = objectUnderTest.getHttpProducerResponse(requestDetailsMock);