diff --git a/bwc-test/src/test/java/org/opensearch/security/bwc/SecurityBackwardsCompatibilityIT.java b/bwc-test/src/test/java/org/opensearch/security/bwc/SecurityBackwardsCompatibilityIT.java index a798dcde1a..4de020ef67 100644 --- a/bwc-test/src/test/java/org/opensearch/security/bwc/SecurityBackwardsCompatibilityIT.java +++ b/bwc-test/src/test/java/org/opensearch/security/bwc/SecurityBackwardsCompatibilityIT.java @@ -256,7 +256,10 @@ private void ingestData(String index) throws IOException { ); responses.forEach(r -> assertThat(r.getStatusLine().getStatusCode(), is(200))); for (Response response : responses) { - log.info("bulk response {}", responseAsMap(response)); + Map responseMap = responseAsMap(response); + List itemResults = (List) XContentMapValues.extractValue(responseMap, "items", "index", "result"); + assertTrue("More than 0 response items", itemResults.size() > 0); + assertTrue("All results are 'created': " + itemResults, itemResults.stream().allMatch(i -> i.equals("created"))); } } } @@ -333,7 +336,7 @@ private void createTestRoleIfNotExists(String role) throws IOException { + " \"index_patterns\": [\n" + " \"test_index*\"\n" + " ],\n" - // + " \"dls\": \"{ \\\"bool\\\": { \\\"must\\\": { \\\"match\\\": { \\\"genre\\\": \\\"rock\\\" } } } }\",\n" + + " \"dls\": \"{ \\\"bool\\\": { \\\"must\\\": { \\\"match\\\": { \\\"genre\\\": \\\"rock\\\" } } } }\",\n" + " \"fls\": [\n" + " \"~lyrics\"\n" + " ],\n"