aboutsummaryrefslogtreecommitdiffstats
path: root/prh-app-server/src/test/java/org
diff options
context:
space:
mode:
authorpwielebs <piotr.wielebski@nokia.com>2018-05-21 12:50:27 +0200
committerpwielebs <piotr.wielebski@nokia.com>2018-05-22 15:39:53 +0200
commit91292c21d8ee51c3840ed455955636b7ceda36fb (patch)
tree9686880ba4e1d48a7dfd471e5dd99405b65990c6 /prh-app-server/src/test/java/org
parent35ee40c8133d4984ce2eeb580d8e757edc304e66 (diff)
Removing warnings related to optionals
Change-Id: I4116ee1b16d8600a3f7109290b2f69b31fd51133 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/AAIProducerTaskImplTest.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AAIProducerTaskImplTest.java b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AAIProducerTaskImplTest.java
index c82a98e4..70da39b7 100644
--- a/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AAIProducerTaskImplTest.java
+++ b/prh-app-server/src/test/java/org/onap/dcaegen2/services/prh/tasks/AAIProducerTaskImplTest.java
@@ -30,6 +30,7 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
import static org.mockito.Mockito.when;
import java.io.IOException;
+import java.net.URISyntaxException;
import java.util.Optional;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.BeforeAll;
@@ -95,7 +96,7 @@ class AAIProducerTaskImplTest {
}
@Test
- public void whenPassedObjectFits_ReturnsCorrectStatus() throws AAINotFoundException, IOException {
+ public void whenPassedObjectFits_ReturnsCorrectStatus() throws AAINotFoundException, URISyntaxException {
//given/when
getAAIProducerTask_whenMockingResponseObject(200, false);
ConsumerDmaapModel response = aaiProducerTask.execute(consumerDmaapModel);
@@ -109,7 +110,7 @@ class AAIProducerTaskImplTest {
@Test
- public void whenPassedObjectFits_butIncorrectResponseReturns() throws IOException {
+ public void whenPassedObjectFits_butIncorrectResponseReturns() throws IOException, URISyntaxException {
//given/when
getAAIProducerTask_whenMockingResponseObject(400, false);
Executable executableCode = () -> aaiProducerTask.execute(consumerDmaapModel);
@@ -121,7 +122,7 @@ class AAIProducerTaskImplTest {
}
@Test
- public void whenPassedObjectFits_butHTTPClientThrowsIOExceptionHandleIt() throws IOException {
+ public void whenPassedObjectFits_butHTTPClientThrowsIOExceptionHandleIt() throws URISyntaxException {
//given/when
getAAIProducerTask_whenMockingResponseObject(0, true);
@@ -135,10 +136,11 @@ class AAIProducerTaskImplTest {
private static void getAAIProducerTask_whenMockingResponseObject(int statusCode, boolean throwsException)
- throws IOException {
+ throws URISyntaxException {
+ //given
aaiProducerClient = mock(AAIProducerClient.class);
if (throwsException) {
- when(aaiProducerClient.getHttpResponse(consumerDmaapModel)).thenThrow(IOException.class);
+ when(aaiProducerClient.getHttpResponse(consumerDmaapModel)).thenThrow(URISyntaxException.class);
} else {
when(aaiProducerClient.getHttpResponse(consumerDmaapModel)).thenReturn(Optional.of(statusCode));
}