use of ch.aaap.harvestclient.domain.param.UserAssignmentUpdateInfo in project harvest-client by 3AP-AG.
the class UserAssignmentsApiUpdateTest method changeActive.
@Test
void changeActive() {
userAssignment = userAssignmentApi.create(projectReference, ImmutableUserAssignment.builder().user(userReference).build());
UserAssignmentUpdateInfo updateInfo = ImmutableUserAssignmentUpdateInfo.builder().active(false).build();
UserAssignment updatedUserAssignment = userAssignmentApi.update(projectReference, userAssignment, updateInfo);
assertThat(updatedUserAssignment.getActive()).isEqualTo(updateInfo.getActive());
}
use of ch.aaap.harvestclient.domain.param.UserAssignmentUpdateInfo in project harvest-client by 3AP-AG.
the class UserAssignmentsApiUpdateTest method changeUser.
@Test
void changeUser() {
Reference<User> anotherUserReference = ExistingData.getInstance().getAnotherUserReference();
userAssignment = userAssignmentApi.create(projectReference, ImmutableUserAssignment.builder().user(userReference).build());
UserAssignmentUpdateInfo updateInfo = ImmutableUserAssignmentUpdateInfo.builder().user(anotherUserReference).build();
UserAssignment updatedUserAssignment = userAssignmentApi.update(projectReference, userAssignment, updateInfo);
// Changing user id has been disabled by Harvest
assertThat(updatedUserAssignment.getUser().getId()).isEqualTo(userReference.getId());
}
use of ch.aaap.harvestclient.domain.param.UserAssignmentUpdateInfo in project harvest-client by 3AP-AG.
the class UserAssignmentsApiUpdateTest method changeAll.
@Test
void changeAll() {
userAssignment = userAssignmentApi.create(projectReference, ImmutableUserAssignment.builder().user(userReference).build());
UserAssignmentUpdateInfo updateInfo = ImmutableUserAssignmentUpdateInfo.builder().hourlyRate(110.).budget(11111111.).build();
UserAssignment updatedUserAssignment = userAssignmentApi.update(projectReference, userAssignment, updateInfo);
assertThat(updatedUserAssignment).isEqualToComparingOnlyGivenFields(updateInfo, "hourlyRate", "budget");
}
Aggregations