summaryrefslogtreecommitdiffstats
path: root/common/src/test/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/test/java/org')
-rw-r--r--common/src/test/java/org/onap/so/client/aai/AAIResourcesClientTest.java18
1 files changed, 18 insertions, 0 deletions
diff --git a/common/src/test/java/org/onap/so/client/aai/AAIResourcesClientTest.java b/common/src/test/java/org/onap/so/client/aai/AAIResourcesClientTest.java
index a55fbc9517..73fbff6e4f 100644
--- a/common/src/test/java/org/onap/so/client/aai/AAIResourcesClientTest.java
+++ b/common/src/test/java/org/onap/so/client/aai/AAIResourcesClientTest.java
@@ -35,6 +35,7 @@ import static org.junit.Assert.assertThat;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.spy;
+import javax.ws.rs.BadRequestException;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;
@@ -207,6 +208,23 @@ public class AAIResourcesClientTest {
}
@Test
+ public void verifyFailedCallException() {
+ AAIResourceUri path = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "test");
+ wireMockRule.stubFor(get(
+ urlPathEqualTo("/aai/" + AAIVersion.LATEST + path.build()))
+ .willReturn(
+ aResponse()
+ .withHeader("Content-Type", "text/plain")
+ .withBodyFile("aai/error-message.json")
+ .withStatus(400)));
+ AAIResourcesClient client= aaiClient;
+
+ thrown.expect(BadRequestException.class);
+ thrown.expectMessage(containsString("Invalid input performing PUT on url (msg=Precondition Required:resource-version not passed for update of url"));
+ AAIResultWrapper result = client.get(path);
+ }
+
+ @Test
public void buildRelationshipTest() {
AAIResourcesClient client = aaiClient;
AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIObjectType.GENERIC_VNF, "test");