use of org.icij.datashare.PropertiesProvider in project datashare by ICIJ.
the class IndexResourceTest method test_no_auth_get_forward_request_to_elastic.
@Test
public void test_no_auth_get_forward_request_to_elastic() {
configure(routes -> routes.add(new IndexResource(indexer)).filter(new LocalUserFilter(new PropertiesProvider(new HashMap<String, String>() {
{
put("defaultUserName", "test");
}
}))));
get("/api/index/search/test-datashare/_search").should().respond(200).contain("\"successful\":1");
}
use of org.icij.datashare.PropertiesProvider in project datashare by ICIJ.
the class ProjectResourceTest method setUp.
@Before
public void setUp() {
initMocks(this);
configure(routes -> routes.add(new ProjectResource(repository, indexer)).filter(new LocalUserFilter(new PropertiesProvider())));
}
use of org.icij.datashare.PropertiesProvider in project datashare by ICIJ.
the class StatusResourceTest method test_get_queue_with_io_exception.
@Test
public void test_get_queue_with_io_exception() {
DocumentQueue mockQueue = mock(DocumentQueue.class);
when(mockQueue.size()).thenThrow(new RuntimeException("test"));
when(documentCollectionFactory.createQueue(any(), eq(new PropertiesProvider().get(PropertiesProvider.QUEUE_NAME_OPTION).orElse("extract:queue")))).thenReturn(mockQueue);
configure(routes -> routes.add(new StatusResource(new PropertiesProvider(), repository, indexer, dataBus, documentCollectionFactory)));
get("/api/status").should().respond(200).contain("\"document_queue_status\":false");
}
Aggregations