From 2be82ac97b03578c6c9dd92daee8d936cfba4933 Mon Sep 17 00:00:00 2001 From: Jarkko Pesonen <435495+jrkkp@users.noreply.github.com> Date: Thu, 19 Dec 2024 10:27:19 +0200 Subject: [PATCH] VKT(Backend): prettier --- .../vkt/src/test/java/fi/oph/vkt/Factory.java | 14 +++- .../ExaminerEnrollmentServiceTest.java | 68 ++++++++++--------- 2 files changed, 47 insertions(+), 35 deletions(-) diff --git a/backend/vkt/src/test/java/fi/oph/vkt/Factory.java b/backend/vkt/src/test/java/fi/oph/vkt/Factory.java index 4842389c9..56b95f60e 100644 --- a/backend/vkt/src/test/java/fi/oph/vkt/Factory.java +++ b/backend/vkt/src/test/java/fi/oph/vkt/Factory.java @@ -43,7 +43,11 @@ public static ExaminerExamEvent examinerExamEvent(final Examiner examiner, final return examinerExamEvent(examiner, municipality, ExamLanguage.FI); } - public static ExaminerExamEvent examinerExamEvent(final Examiner examiner, final Municipality municipality, final ExamLanguage language) { + public static ExaminerExamEvent examinerExamEvent( + final Examiner examiner, + final Municipality municipality, + final ExamLanguage language + ) { final ExaminerExamEvent examEvent = new ExaminerExamEvent(); examEvent.setLanguage(language); examEvent.setExaminer(examiner); @@ -91,7 +95,11 @@ public static Enrollment enrollment(final ExamEvent examEvent, final Person pers return enrollment; } - public static EnrollmentAppointment enrollmentAppointment(final Examiner examiner, final ExaminerExamEvent examEvent, final Person person) { + public static EnrollmentAppointment enrollmentAppointment( + final Examiner examiner, + final ExaminerExamEvent examEvent, + final Person person + ) { final EnrollmentAppointment enrollment = new EnrollmentAppointment(); enrollment.setExaminer(examiner); enrollment.setOralSkill(true); @@ -160,7 +168,7 @@ public static Examiner examiner() { examiner.setPhoneNumber("12345678"); examiner.setNickname("Vepe"); - return examiner; + return examiner; } public static Municipality municipality() { diff --git a/backend/vkt/src/test/java/fi/oph/vkt/service/ExaminerEnrollmentServiceTest.java b/backend/vkt/src/test/java/fi/oph/vkt/service/ExaminerEnrollmentServiceTest.java index edb9dce98..bf86defcb 100644 --- a/backend/vkt/src/test/java/fi/oph/vkt/service/ExaminerEnrollmentServiceTest.java +++ b/backend/vkt/src/test/java/fi/oph/vkt/service/ExaminerEnrollmentServiceTest.java @@ -48,7 +48,6 @@ import org.springframework.core.env.Environment; import org.springframework.security.test.context.support.WithMockUser; - @WithMockUser @DataJpaTest public class ExaminerEnrollmentServiceTest { @@ -81,15 +80,16 @@ public void setup() { final UUIDSource uuidSource = mock(UUIDSource.class); when(uuidSource.getRandomNonce()).thenReturn("269a2da4-58bb-45eb-b125-522b77e9167c"); - examinerEnrollmentService = new ExaminerEnrollmentService( - enrollmentAppointmentRepository, - enrollmentGradesRepository, - examinerExamEventRepository, - environment, - uuidSource, - examinerEnrollmentEmailService, - auditService - ); + examinerEnrollmentService = + new ExaminerEnrollmentService( + enrollmentAppointmentRepository, + enrollmentGradesRepository, + examinerExamEventRepository, + environment, + uuidSource, + examinerEnrollmentEmailService, + auditService + ); } @Test @@ -107,7 +107,11 @@ public void testUpdate() { entityManager.persist(enrollment); final ExaminerEnrollmentAppointmentUpdateDTO dto = createUpdateDTOAddingOne(enrollment); - final ExaminerEnrollmentAppointmentDTO responseDTO = examinerEnrollmentService.updateAppointment(examiner.getOid(), enrollment.getId(), dto); + final ExaminerEnrollmentAppointmentDTO responseDTO = examinerEnrollmentService.updateAppointment( + examiner.getOid(), + enrollment.getId(), + dto + ); assertEquals(responseDTO.id(), dto.id()); assertEquals(responseDTO.version(), dto.version() + 1); @@ -129,26 +133,26 @@ public void testUpdate() { private ExaminerEnrollmentAppointmentUpdateDTO createUpdateDTOAddingOne(final EnrollmentAppointment enrollment) { return ExaminerEnrollmentAppointmentUpdateDTO - .builder() - .id(enrollment.getId()) - .firstName("Irma") - .lastName("Ilmoittautuja") - .version(enrollment.getVersion()) - .oralSkill(!enrollment.isOralSkill()) - .textualSkill(!enrollment.isTextualSkill()) - .understandingSkill(!enrollment.isUnderstandingSkill()) - .speakingPartialExam(!enrollment.isSpeakingPartialExam()) - .speechComprehensionPartialExam(!enrollment.isSpeechComprehensionPartialExam()) - .writingPartialExam(!enrollment.isWritingPartialExam()) - .readingComprehensionPartialExam(!enrollment.isReadingComprehensionPartialExam()) - .previousEnrollment(enrollment.getPreviousEnrollment() != null ? enrollment.getPreviousEnrollment() + "X" : null) - .email(enrollment.getEmail() + "x") - .phoneNumber(enrollment.getPhoneNumber() + "X") - .street(enrollment.getStreet() + "X") - .postalCode(enrollment.getPostalCode() + "X") - .town(enrollment.getTown() + "X") - .country(enrollment.getCountry() + "X") - .hasPreviousEnrollment(true) - .build(); + .builder() + .id(enrollment.getId()) + .firstName("Irma") + .lastName("Ilmoittautuja") + .version(enrollment.getVersion()) + .oralSkill(!enrollment.isOralSkill()) + .textualSkill(!enrollment.isTextualSkill()) + .understandingSkill(!enrollment.isUnderstandingSkill()) + .speakingPartialExam(!enrollment.isSpeakingPartialExam()) + .speechComprehensionPartialExam(!enrollment.isSpeechComprehensionPartialExam()) + .writingPartialExam(!enrollment.isWritingPartialExam()) + .readingComprehensionPartialExam(!enrollment.isReadingComprehensionPartialExam()) + .previousEnrollment(enrollment.getPreviousEnrollment() != null ? enrollment.getPreviousEnrollment() + "X" : null) + .email(enrollment.getEmail() + "x") + .phoneNumber(enrollment.getPhoneNumber() + "X") + .street(enrollment.getStreet() + "X") + .postalCode(enrollment.getPostalCode() + "X") + .town(enrollment.getTown() + "X") + .country(enrollment.getCountry() + "X") + .hasPreviousEnrollment(true) + .build(); } }