use of ch.aaap.harvestclient.domain.Project in project harvest-client by 3AP-AG.
the class ProjectsApiCreateTest method createDefaultBilling.
@ParameterizedTest
@EnumSource(Project.BillingMethod.class)
void createDefaultBilling(Project.BillingMethod billingMethod, TestInfo testInfo) {
Reference<Client> clientReference = ExistingData.getInstance().getClientReference();
String name = "Project for test " + testInfo.getDisplayName();
boolean billable = true;
Project.BudgetMethod budgetBy = Project.BudgetMethod.HOURS_PER_PROJECT;
Project creationInfo = ImmutableProject.builder().client(clientReference).name(name).billable(billable).billBy(billingMethod).budgetBy(budgetBy).build();
project = projectsApi.create(creationInfo);
assertThat(project.getBillable()).isEqualTo(billable);
assertThat(project.getBillBy()).isEqualTo(billingMethod);
assertThat(project.getBudgetBy()).isEqualTo(budgetBy);
assertThat(project.getName()).isEqualTo(name);
assertThat(project.getClient().getId()).isEqualTo(clientReference.getId());
}
use of ch.aaap.harvestclient.domain.Project 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);
}
Aggregations