Skip to content

Commit

Permalink
Added a test request in integration test for ensuring auditlog creati…
Browse files Browse the repository at this point in the history
…on before actual test

Signed-off-by: Ganesh Bombatkar <[email protected]>
  • Loading branch information
Ganesh Bombatkar committed Feb 3, 2025
1 parent 2a6ebd1 commit e7bf71e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class InternalAuditLogTest {
@Test
public void testAuditLogShouldBeGreenInSingleNodeCluster() throws IOException {
try (TestRestClient client = cluster.getRestClient(USER_ADMIN)) {
client.get(""); // demo request for insuring audit-log index is created beforehand
TestRestClient.HttpResponse indicesResponse = client.get("_cat/indices");

assertThat(indicesResponse.getBody(), containsString("security-auditlog"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public boolean doStore(final AuditMessage msg, String indexName) {
try {
boolean ok = createIndexIfAbsent(indexName);
if (!ok) {
log.error("Server not acknowledge for creation of index {}", indexName);
log.error("Failed to create index {}", indexName);
return false;

Check warning on line 80 in src/main/java/org/opensearch/security/auditlog/sink/AbstractInternalOpenSearchSink.java

View check run for this annotation

Codecov / codecov/patch

src/main/java/org/opensearch/security/auditlog/sink/AbstractInternalOpenSearchSink.java#L79-L80

Added lines #L79 - L80 were not covered by tests
}

Expand Down

0 comments on commit e7bf71e

Please sign in to comment.