use of net.codestory.http.routes.Routes in project datashare by ICIJ.
the class UserTaskResourceTest method setupAppWith.
private void setupAppWith(String... userLogins) {
final PropertiesProvider propertiesProvider = new PropertiesProvider();
taskManager = new TaskManagerMemory(propertiesProvider);
configure(new CommonMode(new Properties()) {
@Override
protected void configure() {
bind(PropertiesProvider.class).toInstance(propertiesProvider);
bind(PipelineRegistry.class).toInstance(mock(PipelineRegistry.class));
bind(SessionIdStore.class).toInstance(SessionIdStore.inMemory());
bind(TaskManager.class).toInstance(taskManager);
bind(Filter.class).toInstance(new BasicAuthFilter("/", "ds", DatashareUser.users(userLogins)));
bind(TaskFactory.class).toInstance(mock(TaskFactory.class));
bind(Indexer.class).toInstance(mock(Indexer.class));
}
@Override
protected Routes addModeConfiguration(Routes routes) {
return routes.add(TaskResource.class).filter(Filter.class);
}
}.createWebConfiguration());
}
use of net.codestory.http.routes.Routes in project datashare by ICIJ.
the class TaskResourceTest method setUp.
@Before
public void setUp() {
PipelineRegistry pipelineRegistry = new PipelineRegistry(new PropertiesProvider());
pipelineRegistry.register(EmailPipeline.class);
configure(new CommonMode(new Properties()) {
@Override
protected void configure() {
bind(TaskFactory.class).toInstance(taskFactory);
bind(Indexer.class).toInstance(mock(Indexer.class));
bind(TaskManager.class).toInstance(taskManager);
bind(PipelineRegistry.class).toInstance(pipelineRegistry);
bind(Filter.class).to(LocalUserFilter.class).asEagerSingleton();
bind(PropertiesProvider.class).toInstance(new PropertiesProvider(getDefaultProperties()));
}
@Override
protected Routes addModeConfiguration(Routes routes) {
return routes.add(TaskResource.class).filter(LocalUserFilter.class);
}
}.createWebConfiguration());
init(taskFactory);
}
Aggregations