use of org.graylog.security.entities.EntityOwnershipService in project graylog2-server by Graylog2.
the class ViewSharingToGrantsMigrationTest method setUp.
@BeforeEach
void setUp(MongoDBTestService mongodb, MongoJackObjectMapperProvider objectMapperProvider, GRNRegistry grnRegistry, @Mock ClusterConfigService clusterConfigService, @Mock UserService userService, @Mock RoleService roleService) {
this.dbCollection = mongodb.mongoCollection("view_sharings");
this.userService = userService;
this.roleService = roleService;
this.grantService = new DBGrantService(mongodb.mongoConnection(), objectMapperProvider, grnRegistry);
when(userService.load(anyString())).thenAnswer(a -> {
final String argument = a.getArgument(0);
return createUser(argument);
});
final EntityOwnershipService entityOwnershipService = new EntityOwnershipService(grantService, grnRegistry);
final TestViewService viewService = new TestViewService(mongodb.mongoConnection(), objectMapperProvider, clusterConfigService, entityOwnershipService);
this.migration = new ViewSharingToGrantsMigration(mongodb.mongoConnection(), grantService, userService, roleService, "admin", viewService, grnRegistry);
}
use of org.graylog.security.entities.EntityOwnershipService in project graylog2-server by Graylog2.
the class ViewOwnershipToGrantsMigrationTest method setUp.
@BeforeEach
void setUp(MongoDBTestService mongodb, MongoJackObjectMapperProvider objectMapperProvider, GRNRegistry grnRegistry, @Mock ClusterConfigService clusterConfigService, @Mock UserService userService, @Mock ViewSummaryService viewSummaryService) {
this.userService = userService;
this.grantService = new DBGrantService(mongodb.mongoConnection(), objectMapperProvider, grnRegistry);
final EntityOwnershipService entityOwnershipService = new EntityOwnershipService(grantService, grnRegistry);
final TestViewService viewService = new TestViewService(mongodb.mongoConnection(), objectMapperProvider, clusterConfigService, entityOwnershipService, viewSummaryService);
this.migration = new ViewOwnerShipToGrantsMigration(userService, grantService, "admin", viewService, grnRegistry);
}
Aggregations