Search in sources :

Example 6 with Project

use of org.icij.datashare.text.Project in project datashare by ICIJ.

the class JooqRepositoryTest method test_save_read_project.

@Test
public void test_save_read_project() {
    assertThat(repository.save(new Project("prj", Paths.get("/source"), "10.0.*.*"))).isTrue();
    assertThat(repository.getProject("prj").name).isEqualTo("prj");
    assertThat(repository.getProject("prj").sourcePath.toString()).isEqualTo("/source");
    assertThat(repository.getProject("prj").allowFromMask).isEqualTo("10.0.*.*");
}
Also used : Project(org.icij.datashare.text.Project) Test(org.junit.Test)

Example 7 with Project

use of org.icij.datashare.text.Project in project datashare by ICIJ.

the class ProjectResourceTest method test_is_not_allowed.

@Test
public void test_is_not_allowed() {
    when(repository.getProject("projectId")).thenReturn(new Project("projectId", "127.0.0.2"));
    get("/api/project/isDownloadAllowed/projectId").should().respond(403);
}
Also used : Project(org.icij.datashare.text.Project) AbstractProdWebServerTest(org.icij.datashare.web.testhelpers.AbstractProdWebServerTest) Test(org.junit.Test)

Aggregations

Project (org.icij.datashare.text.Project)7 Test (org.junit.Test)6 AbstractProdWebServerTest (org.icij.datashare.web.testhelpers.AbstractProdWebServerTest)5 Inject (com.google.inject.Inject)1 Singleton (com.google.inject.Singleton)1 File (java.io.File)1 IOException (java.io.IOException)1 Boolean (java.lang.Boolean)1 Integer.parseInt (java.lang.Integer.parseInt)1 String.format (java.lang.String.format)1 java.util (java.util)1 Arrays.stream (java.util.Arrays.stream)1 BlockingQueue (java.util.concurrent.BlockingQueue)1 Collectors (java.util.stream.Collectors)1 Context (net.codestory.http.Context)1 Part (net.codestory.http.Part)1 net.codestory.http.annotations (net.codestory.http.annotations)1 NotFoundException (net.codestory.http.errors.NotFoundException)1 UnauthorizedException (net.codestory.http.errors.UnauthorizedException)1 Payload (net.codestory.http.payload.Payload)1