Skip to content

Commit

Permalink
Explicitly create index before ingesting document in ComplianceAuditl…
Browse files Browse the repository at this point in the history
…ogTest.testWriteLogDiffsEnabledAndLogRequestBodyDisabled (#4919)

Signed-off-by: Craig Perkins <[email protected]>
  • Loading branch information
cwperks authored Nov 20, 2024
1 parent 5698a10 commit deb9c43
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -475,11 +475,15 @@ public void testWriteLogDiffsEnabledAndLogRequestBodyDisabled() throws Exception
);
updateAuditConfig(AuditTestUtils.createAuditPayload(auditConfig));

try (Client tc = getClient()) {
rh.executePutRequest("emp", "{\"settings\": {\"index\": {\"number_of_shards\": 1, \"number_of_replicas\": 0}}}");
}

List<AuditMessage> messages = TestAuditlogImpl.doThenWaitForMessages(() -> {
try (Client tc = getClient()) {
rh.executePutRequest("emp/_doc/0?refresh", "{\"name\" : \"Criag\", \"title\" : \"Software Engineer\"}");
}
}, 7);
}, 3);

AuditMessage complianceDocWriteMessage = messages.stream()
.filter(m -> m.getCategory().equals(AuditCategory.COMPLIANCE_DOC_WRITE))
Expand Down

0 comments on commit deb9c43

Please sign in to comment.