summaryrefslogtreecommitdiffstats
path: root/common/src/test
diff options
context:
space:
mode:
authorBenjamin, Max (mb388a) <mb388a@us.att.com>2019-02-22 17:51:42 -0500
committerBenjamin, Max (mb388a) <mb388a@us.att.com>2019-02-22 17:51:56 -0500
commit57af0e334073b329ca9f48b353ab4cc3bd2027a8 (patch)
tree8df57e53bc98bec68b3fa12e7c0ab3694f71c994 /common/src/test
parent3163cdda24894994dbfa834dbf530bea71e076ba (diff)
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) <mb388a@us.att.com>
Diffstat (limited to 'common/src/test')
-rw-r--r--common/src/test/java/org/onap/so/client/aai/AAIResourcesClientTest.java18
-rw-r--r--common/src/test/resources/__files/aai/error-message.json1
2 files changed, 19 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");
diff --git a/common/src/test/resources/__files/aai/error-message.json b/common/src/test/resources/__files/aai/error-message.json
new file mode 100644
index 0000000000..155232294a
--- /dev/null
+++ b/common/src/test/resources/__files/aai/error-message.json
@@ -0,0 +1 @@
+{"requestError":{"serviceException":{"messageId":"SVC3000","text":"Invalid input performing %1 on %2 (msg=%3) (ec=%4)","variables":["PUT","url","Precondition Required:resource-version not passed for update of url","ERR.5.4.6130"]}}} \ No newline at end of file