aboutsummaryrefslogtreecommitdiffstats
path: root/prh-app-server/src/test/java
diff options
context:
space:
mode:
authorLusheng Ji <lji@research.att.com>2018-05-22 16:13:32 +0000
committerGerrit Code Review <gerrit@onap.org>2018-05-22 16:13:32 +0000
commit58d7f019d3ef6d378c9c3625773f49e79060e20f (patch)
treec7e298bada9cf31463544ead582ee4bb8f6c79b7 /prh-app-server/src/test/java
parent69da977930bf2ec5a7665f0144e698118c3e0f1b (diff)
parent91292c21d8ee51c3840ed455955636b7ceda36fb (diff)
Merge "Removing warnings related to optionals"
Diffstat (limited to 'prh-app-server/src/test/java')
-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));
}