Search in sources :

Example 11 with LocalUserFilter

use of org.icij.datashare.session.LocalUserFilter 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");
}
Also used : PropertiesProvider(org.icij.datashare.PropertiesProvider) LocalUserFilter(org.icij.datashare.session.LocalUserFilter) HashMap(java.util.HashMap) AbstractProdWebServerTest(org.icij.datashare.web.testhelpers.AbstractProdWebServerTest) Test(org.junit.Test)

Example 12 with LocalUserFilter

use of org.icij.datashare.session.LocalUserFilter 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())));
}
Also used : PropertiesProvider(org.icij.datashare.PropertiesProvider) LocalUserFilter(org.icij.datashare.session.LocalUserFilter) Before(org.junit.Before)

Aggregations

PropertiesProvider (org.icij.datashare.PropertiesProvider)12 LocalUserFilter (org.icij.datashare.session.LocalUserFilter)12 Before (org.junit.Before)6 HashMap (java.util.HashMap)5 AbstractProdWebServerTest (org.icij.datashare.web.testhelpers.AbstractProdWebServerTest)5 Test (org.junit.Test)5 BatchSearch (org.icij.datashare.batch.BatchSearch)1 BatchSearchRepository (org.icij.datashare.batch.BatchSearchRepository)1 SearchResult (org.icij.datashare.batch.SearchResult)1 JooqBatchSearchRepository (org.icij.datashare.db.JooqBatchSearchRepository)1