use of org.icij.datashare.session.YesBasicAuthFilter in project datashare by ICIJ.
the class ProjectResourceTest method test_delete_project_with_unauthorized_user.
@Test
public void test_delete_project_with_unauthorized_user() {
configure(routes -> routes.add(new ProjectResource(repository, indexer)).filter(new YesBasicAuthFilter(new PropertiesProvider())));
when(repository.deleteAll("projectId")).thenReturn(true);
delete("/api/project/hacker-datashare").withPreemptiveAuthentication("hacker", "pass").should().respond(401);
delete("/api/project/projectId").should().respond(401);
}
Aggregations