use of org.graylog.plugins.views.search.permissions.SearchUser in project graylog2-server by Graylog2.
the class SearchDomainTest method saveAddsOwnerToSearch.
@Test
public void saveAddsOwnerToSearch() {
final Search search = mockSearchWithOwner(null);
final SearchUser searchUser = mock(SearchUser.class);
when(searchUser.username()).thenReturn("eberhard");
when(searchUser.isAdmin()).thenReturn(true);
sut.saveForUser(search, searchUser);
final ArgumentCaptor<Search> savedCaptor = ArgumentCaptor.forClass(Search.class);
verify(dbService, times(1)).save(savedCaptor.capture());
final Search result = savedCaptor.getValue();
assertThat(result.owner()).contains("eberhard");
}
Aggregations