Search in sources :

Example 1 with BuiltinCapabilities

use of org.graylog.security.BuiltinCapabilities in project graylog2-server by Graylog2.

the class EntitySharesServiceTest method setUp.

@BeforeEach
void setUp(MongoDBTestService mongodb, MongoJackObjectMapperProvider mongoJackObjectMapperProvider, GRNRegistry grnRegistry) {
    this.grnRegistry = grnRegistry;
    dbGrantService = new DBGrantService(mongodb.mongoConnection(), mongoJackObjectMapperProvider, this.grnRegistry);
    lenient().when(entityDependencyResolver.resolve(any())).thenReturn(ImmutableSet.of());
    lenient().when(entityDependencyPermissionChecker.check(any(), any(), any())).thenReturn(ImmutableMultimap.of());
    lenient().when(granteeService.getAvailableGrantees(any())).thenReturn(ImmutableSet.of());
    final EventBus serverEventBus = mock(EventBus.class);
    this.entitySharesService = new EntitySharesService(dbGrantService, entityDependencyResolver, entityDependencyPermissionChecker, grnRegistry, granteeService, serverEventBus);
    // TODO this is needed to initialize the CAPABILITIES field
    new BuiltinCapabilities();
}
Also used : BuiltinCapabilities(org.graylog.security.BuiltinCapabilities) DBGrantService(org.graylog.security.DBGrantService) EventBus(com.google.common.eventbus.EventBus) BeforeEach(org.junit.jupiter.api.BeforeEach)

Aggregations

EventBus (com.google.common.eventbus.EventBus)1 BuiltinCapabilities (org.graylog.security.BuiltinCapabilities)1 DBGrantService (org.graylog.security.DBGrantService)1 BeforeEach (org.junit.jupiter.api.BeforeEach)1