Skip to content

Commit

Permalink
VKT(Backend): test for updating enrollment
Browse files Browse the repository at this point in the history
  • Loading branch information
jrkkp committed Jan 5, 2024
1 parent a0232a1 commit 8c73056
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,22 @@ public void testInitialiseEnrollmentShouldUpdateExpiresAtForExistingReservation(
assertTrue(reservationRepository.findById(dto.reservation().id()).isPresent());
}

@Test
public void testUpdateCanceledEnrollment() {
final ExamEvent examEvent = createExamEvent(2);
final Enrollment enrollment = createEnrollment(examEvent, EnrollmentStatus.EXPECTING_PAYMENT_UNFINISHED_ENROLLMENT);
final Person person = enrollment.getPerson();

publicEnrollmentService.initialiseEnrollment(examEvent.getId(), person);
assertEquals(EnrollmentStatus.CANCELED_UNFINISHED_ENROLLMENT, enrollment.getStatus());

final PublicEnrollmentCreateDTO dto = createDTOBuilder().oralSkill(false).digitalCertificateConsent(false).build();
publicEnrollmentService.updateEnrollmentForPayment(dto, examEvent.getId(), person);

assertEquals(EnrollmentStatus.EXPECTING_PAYMENT_UNFINISHED_ENROLLMENT, enrollment.getStatus());
assertFalse(enrollment.isOralSkill());
}

@Test
public void testInitialiseEnrollmentWithUnfinishedPayment() {
final ExamEvent examEvent = createExamEvent(2);
Expand Down

0 comments on commit 8c73056

Please sign in to comment.