use of org.graylog.plugins.views.search.export.CommandFactory in project graylog2-server by Graylog2.
the class MessagesResourceTest method setUp.
@BeforeEach
void setUp() {
GuiceInjectorHolder.createInjector(Collections.emptyList());
currentUser = mock(User.class);
when(currentUser.getName()).thenReturn("peterchen");
MessagesExporter exporter = mock(MessagesExporter.class);
commandFactory = mock(CommandFactory.class);
when(commandFactory.buildFromRequest(any())).thenReturn(ExportMessagesCommand.withDefaults());
when(commandFactory.buildWithSearchOnly(any(), any())).thenReturn(ExportMessagesCommand.withDefaults());
when(commandFactory.buildWithMessageList(any(), any(), any())).thenReturn(ExportMessagesCommand.withDefaults());
permittedStreams = mock(PermittedStreams.class);
when(permittedStreams.load(any())).thenReturn(ImmutableSet.of("a-default-stream"));
executionGuard = mock(SearchExecutionGuard.class);
SearchDomain searchDomain = mock(SearchDomain.class);
final QueryValidationServiceImpl validationService = new QueryValidationServiceImpl(new LuceneQueryParser(), (streamIds, timeRange) -> Collections.emptySet(), new QueryStringDecorators(Collections.emptySet()));
sut = new MessagesTestResource(exporter, commandFactory, searchDomain, executionGuard, permittedStreams, mock(ObjectMapper.class), eventBus, validationService);
sut.asyncRunner = c -> {
c.accept(x -> {
});
return null;
};
}
Aggregations