aboutsummaryrefslogtreecommitdiffstats
path: root/aai-resources/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'aai-resources/src/test/java')
-rw-r--r--aai-resources/src/test/java/org/onap/aai/rest/bulk/BulkSingleTransactionConsumerTest.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/aai-resources/src/test/java/org/onap/aai/rest/bulk/BulkSingleTransactionConsumerTest.java b/aai-resources/src/test/java/org/onap/aai/rest/bulk/BulkSingleTransactionConsumerTest.java
index 7629178..fb9f13f 100644
--- a/aai-resources/src/test/java/org/onap/aai/rest/bulk/BulkSingleTransactionConsumerTest.java
+++ b/aai-resources/src/test/java/org/onap/aai/rest/bulk/BulkSingleTransactionConsumerTest.java
@@ -354,6 +354,19 @@ public class BulkSingleTransactionConsumerTest extends BulkProcessorTestAbstract
assertEquals("Request success", Response.Status.CREATED.getStatusCode(), response.getStatus());
}
+ @Test
+ public void invalidNodeCreationPaylodTest() throws IOException {
+ String payload = getBulkPayload("single-transaction/put-complex-with-missing-properties")
+ .replaceAll("<methodName>", name.getMethodName());
+ Response response = executeRequest(payload);
+
+ assertEquals("Request fails with 400", Response.Status.BAD_REQUEST.getStatusCode(), response.getStatus());
+ assertThat("Response contains correct index of failed operation.", response.getEntity().toString(),
+ containsString("Error with operation 0"));
+ assertThat("Response contains information about missing properties.", response.getEntity().toString(),
+ containsString("Missing required property:"));
+ }
+
protected Response executeRequest(String finalPayload) {
MockHttpServletRequest mockReq = new MockHttpServletRequest(HttpMethod.POST, "http://www.test.com");