Search in sources :

Example 1 with AuditContext

use of org.graylog.plugins.views.search.export.AuditContext in project graylog2-server by Graylog2.

the class MessagesResourceTest method passesOnlyUserNameToAuditingExporterIfExportBasedOnRequest.

@Test
void passesOnlyUserNameToAuditingExporterIfExportBasedOnRequest() {
    final SearchUser searchUser = TestSearchUser.builder().withUser(currentUser).build();
    AtomicReference<AuditContext> context = captureAuditContext();
    sut.retrieve(validRequest(), searchUser);
    assertAll(() -> assertThat(context.get().userName()).isEqualTo(currentUser.getName()), () -> assertThat(context.get().searchId()).isEmpty(), () -> assertThat(context.get().searchTypeId()).isEmpty());
}
Also used : SearchUser(org.graylog.plugins.views.search.permissions.SearchUser) AuditContext(org.graylog.plugins.views.search.export.AuditContext) Test(org.junit.jupiter.api.Test)

Aggregations

AuditContext (org.graylog.plugins.views.search.export.AuditContext)1 SearchUser (org.graylog.plugins.views.search.permissions.SearchUser)1 Test (org.junit.jupiter.api.Test)1