From 7527b98535427de860496faaa5a60d0274ccb5e7 Mon Sep 17 00:00:00 2001 From: Nils Bandener Date: Wed, 16 Oct 2024 19:10:19 +0200 Subject: [PATCH] DLS BWC tests Signed-off-by: Nils Bandener --- .../security/bwc/SecurityBackwardsCompatibilityIT.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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"