From 57af0e334073b329ca9f48b353ab4cc3bd2027a8 Mon Sep 17 00:00:00 2001 From: "Benjamin, Max (mb388a)" Date: Fri, 22 Feb 2019 17:51:42 -0500 Subject: remove payload logging from metric/audit side fixed unit test after changing how entities are read remove payload logging from metric/audit side Change-Id: Ibfe7cf96c76920926e9ae9ce5041389324d09b46 Issue-ID: SO-1564 Signed-off-by: Benjamin, Max (mb388a) --- .../org/onap/so/client/aai/AAIResourcesClientTest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'common/src/test/java/org/onap') 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; @@ -206,6 +207,23 @@ public class AAIResourcesClientTest { AAIResultWrapper result = client.get(path, NotFoundException.class); } + @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; -- cgit 1.2.3-korg