Search in sources :

Example 1 with ProjectFilter

use of ch.aaap.harvestclient.api.filter.ProjectFilter in project harvest-client by 3AP-AG.

the class ProjectsApiListTest method listByUpdated.

@Test
void listByUpdated() {
    ProjectFilter filter = new ProjectFilter();
    filter.setUpdatedSince(Instant.now());
    List<Project> projects = projectsApi.list(filter);
    assertThat(projects).isEmpty();
}
Also used : Project(ch.aaap.harvestclient.domain.Project) ImmutableProject(ch.aaap.harvestclient.domain.ImmutableProject) ProjectFilter(ch.aaap.harvestclient.api.filter.ProjectFilter) HarvestTest(ch.aaap.harvestclient.HarvestTest) Test(org.junit.jupiter.api.Test)

Example 2 with ProjectFilter

use of ch.aaap.harvestclient.api.filter.ProjectFilter in project harvest-client by 3AP-AG.

the class ProjectsApiListTest method listByClient.

@Test
void listByClient(TestInfo testInfo) {
    project = projectsApi.create(ImmutableProject.builder().name("Project for " + testInfo.getDisplayName()).billable(true).billBy(Project.BillingMethod.PROJECT).budgetBy(Project.BudgetMethod.HOURS_PER_PROJECT).client(anotherClient).build());
    ProjectFilter filter = new ProjectFilter();
    filter.setClientReference(client);
    List<Project> projects = projectsApi.list(filter);
    assertThat(projects).doesNotContain(project);
}
Also used : Project(ch.aaap.harvestclient.domain.Project) ImmutableProject(ch.aaap.harvestclient.domain.ImmutableProject) ProjectFilter(ch.aaap.harvestclient.api.filter.ProjectFilter) HarvestTest(ch.aaap.harvestclient.HarvestTest) Test(org.junit.jupiter.api.Test)

Example 3 with ProjectFilter

use of ch.aaap.harvestclient.api.filter.ProjectFilter in project harvest-client by 3AP-AG.

the class ProjectsApiListTest method listByActive.

@Test
void listByActive(TestInfo testInfo) {
    project = projectsApi.create(ImmutableProject.builder().name("Project for " + testInfo.getDisplayName()).billable(true).billBy(Project.BillingMethod.PROJECT).budgetBy(Project.BudgetMethod.HOURS_PER_PROJECT).active(false).client(ExistingData.getInstance().getClientReference()).build());
    ProjectFilter filter = new ProjectFilter();
    filter.setActive(false);
    List<Project> projects = projectsApi.list(filter);
    assertThat(projects).containsExactly(project);
}
Also used : Project(ch.aaap.harvestclient.domain.Project) ImmutableProject(ch.aaap.harvestclient.domain.ImmutableProject) ProjectFilter(ch.aaap.harvestclient.api.filter.ProjectFilter) HarvestTest(ch.aaap.harvestclient.HarvestTest) Test(org.junit.jupiter.api.Test)

Aggregations

HarvestTest (ch.aaap.harvestclient.HarvestTest)3 ProjectFilter (ch.aaap.harvestclient.api.filter.ProjectFilter)3 ImmutableProject (ch.aaap.harvestclient.domain.ImmutableProject)3 Project (ch.aaap.harvestclient.domain.Project)3 Test (org.junit.jupiter.api.Test)3