From 0dbe1d678cf6f2428bc17626bac6b0d29d433121 Mon Sep 17 00:00:00 2001 From: jinhyeon Date: Mon, 23 Dec 2024 05:53:22 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EC=BD=94=EB=93=9C=EC=8A=A4?= =?UTF-8?q?=EB=A9=9C=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/CalculateGraduationService.java | 4 +- .../CommonCultureDetailCategoryManager.java | 1 - .../service/major/ElectiveMajorManager.java | 1 - .../parsing/domain/ParsingInformation.java | 2 +- .../CalculateGraduationServiceTest.java | 103 ------ .../CalculateMajorGraduationServiceTest.java | 322 ++++++++---------- 6 files changed, 138 insertions(+), 295 deletions(-) delete mode 100644 src/test/java/com/plzgraduate/myongjigraduatebe/graduation/application/service/CalculateGraduationServiceTest.java diff --git a/src/main/java/com/plzgraduate/myongjigraduatebe/graduation/application/service/CalculateGraduationService.java b/src/main/java/com/plzgraduate/myongjigraduatebe/graduation/application/service/CalculateGraduationService.java index baf29568..af467d27 100644 --- a/src/main/java/com/plzgraduate/myongjigraduatebe/graduation/application/service/CalculateGraduationService.java +++ b/src/main/java/com/plzgraduate/myongjigraduatebe/graduation/application/service/CalculateGraduationService.java @@ -31,7 +31,7 @@ class CalculateGraduationService implements CalculateGraduationUseCase { @Override - public GraduationResult calculateGraduation(User user) { + public GraduationResult calculateGraduation(User user) { GraduationRequirement graduationRequirement = determineGraduationRequirement(user); TakenLectureInventory takenLectureInventory = findTakenLectureUseCase.findTakenLectures( user.getId() @@ -62,7 +62,7 @@ DetailGraduationResult generateTransferChristianDetailGraduationResult( TakenLectureInventory takenLectureInventory ) { double christianCreditRequirement = graduationRequirement.getChristianCredit(); - double totalTakenCredits = (int) calculateChristianTakenCredits(user, takenLectureInventory) + + double totalTakenCredits = calculateChristianTakenCredits(user, takenLectureInventory) + user.getTransferCredit().getChristianLecture(); if (totalTakenCredits > christianCreditRequirement) { diff --git a/src/main/java/com/plzgraduate/myongjigraduatebe/graduation/domain/service/commonculture/CommonCultureDetailCategoryManager.java b/src/main/java/com/plzgraduate/myongjigraduatebe/graduation/domain/service/commonculture/CommonCultureDetailCategoryManager.java index 715960e6..3c76c60c 100644 --- a/src/main/java/com/plzgraduate/myongjigraduatebe/graduation/domain/service/commonculture/CommonCultureDetailCategoryManager.java +++ b/src/main/java/com/plzgraduate/myongjigraduatebe/graduation/domain/service/commonculture/CommonCultureDetailCategoryManager.java @@ -8,7 +8,6 @@ import static com.plzgraduate.myongjigraduatebe.user.domain.model.EnglishLevel.FREE; import com.plzgraduate.myongjigraduatebe.graduation.domain.model.DetailCategoryResult; -import com.plzgraduate.myongjigraduatebe.graduation.domain.model.DetailGraduationResult; import com.plzgraduate.myongjigraduatebe.lecture.domain.model.CommonCulture; import com.plzgraduate.myongjigraduatebe.lecture.domain.model.CommonCultureCategory; import com.plzgraduate.myongjigraduatebe.lecture.domain.model.Lecture; diff --git a/src/main/java/com/plzgraduate/myongjigraduatebe/graduation/domain/service/major/ElectiveMajorManager.java b/src/main/java/com/plzgraduate/myongjigraduatebe/graduation/domain/service/major/ElectiveMajorManager.java index a30b4b6f..5c8e8ce3 100644 --- a/src/main/java/com/plzgraduate/myongjigraduatebe/graduation/domain/service/major/ElectiveMajorManager.java +++ b/src/main/java/com/plzgraduate/myongjigraduatebe/graduation/domain/service/major/ElectiveMajorManager.java @@ -7,7 +7,6 @@ import java.util.HashSet; import java.util.Set; -import com.plzgraduate.myongjigraduatebe.user.domain.model.User; import org.springframework.stereotype.Component; @Component diff --git a/src/main/java/com/plzgraduate/myongjigraduatebe/parsing/domain/ParsingInformation.java b/src/main/java/com/plzgraduate/myongjigraduatebe/parsing/domain/ParsingInformation.java index b81e3c8f..509f6dba 100644 --- a/src/main/java/com/plzgraduate/myongjigraduatebe/parsing/domain/ParsingInformation.java +++ b/src/main/java/com/plzgraduate/myongjigraduatebe/parsing/domain/ParsingInformation.java @@ -125,7 +125,7 @@ private static ParsingStudentCategoryDto parseStudentCategory(String[] splitText studentCategory = StudentCategory.from(categories); String fourthLine = fourthLineText.substring("편입생 인정학점 - ".length()); transferCredit = TransferCredit.from(Arrays.stream(fourthLine.split(",")) - .map(s -> s.replaceAll("[^0-9]", "")) + .map(s -> s.replaceAll("\\D", "")) .collect(Collectors.joining("/"))); return ParsingStudentCategoryDto.of( diff --git a/src/test/java/com/plzgraduate/myongjigraduatebe/graduation/application/service/CalculateGraduationServiceTest.java b/src/test/java/com/plzgraduate/myongjigraduatebe/graduation/application/service/CalculateGraduationServiceTest.java deleted file mode 100644 index 05068b0f..00000000 --- a/src/test/java/com/plzgraduate/myongjigraduatebe/graduation/application/service/CalculateGraduationServiceTest.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.plzgraduate.myongjigraduatebe.graduation.application.service; - -import static org.assertj.core.api.Assertions.assertThat; -import static org.mockito.BDDMockito.given; -import static org.mockito.Mockito.*; - -import com.plzgraduate.myongjigraduatebe.fixture.UserFixture; -import com.plzgraduate.myongjigraduatebe.graduation.domain.model.DetailGraduationResult; -import com.plzgraduate.myongjigraduatebe.graduation.domain.model.GraduationRequirement; -import com.plzgraduate.myongjigraduatebe.graduation.domain.model.GraduationResult; -import com.plzgraduate.myongjigraduatebe.takenlecture.application.usecase.find.FindTakenLectureUseCase; -import com.plzgraduate.myongjigraduatebe.takenlecture.domain.model.TakenLectureInventory; -import com.plzgraduate.myongjigraduatebe.user.application.usecase.update.UpdateStudentInformationCommand; -import com.plzgraduate.myongjigraduatebe.user.application.usecase.update.UpdateStudentInformationUseCase; -import com.plzgraduate.myongjigraduatebe.user.domain.model.User; -import java.util.List; -import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.extension.ExtendWith; -import org.mockito.InjectMocks; -import org.mockito.Mock; -import org.mockito.junit.jupiter.MockitoExtension; - -@ExtendWith(MockitoExtension.class) -class CalculateGraduationServiceTest { - - @InjectMocks - private CalculateGraduationService calculateGraduationService; - - @Mock - private FindTakenLectureUseCase findTakenLectureUseCase; - - @Mock - private CalculateCommonCultureGraduationService calculateCommonCultureGraduationService; - - @Mock - private CalculateCoreCultureGraduationService calculateCoreCultureGraduationService; - - @Mock - private CalculateBasicAcademicalCultureGraduationService calculateBasicAcademicalCultureGraduationService; - - @Mock - private CalculateMajorGraduationService calculateMajorGraduationService; - - @Mock - private UpdateStudentInformationUseCase updateStudentInformationUseCase; - - @Mock - private TakenLectureInventory takenLectureInventory; - - @BeforeEach - void setup() { - // Mock 동작 설정 - given(calculateCommonCultureGraduationService.calculateSingleDetailGraduation(any(), any(), any(), any())) - .willReturn(DetailGraduationResult.create(null, 0, List.of())); - given(calculateCoreCultureGraduationService.calculateSingleDetailGraduation(any(), any(), any(), any())) - .willReturn(DetailGraduationResult.create(null, 0, List.of())); - - // updateUser 메서드 동작 설정 - doAnswer(invocation -> { - // Mock 동작 (필요하면 로깅 추가 가능) - UpdateStudentInformationCommand command = invocation.getArgument(0); - System.out.println("Mocked updateUser 호출됨: " + command); - return null; // void 반환 - }).when(updateStudentInformationUseCase).updateUser(any()); - } - - - @Test - @DisplayName("일반 학생 졸업 계산 테스트") - void calculateGraduationForNormalStudent() { - // Given - User user = UserFixture.경영학과_19학번_ENG12(); - GraduationRequirement graduationRequirement = mock(GraduationRequirement.class); - given(findTakenLectureUseCase.findTakenLectures(user.getId())).willReturn(takenLectureInventory); - - // When - GraduationResult result = calculateGraduationService.calculateGraduation(user); - - // Then - assertThat(result).isNotNull(); - verify(findTakenLectureUseCase, times(1)).findTakenLectures(user.getId()); - verify(updateStudentInformationUseCase, times(1)).updateUser(any()); - } - - @Test - @DisplayName("편입생 졸업 계산 테스트") - void calculateGraduationForTransferStudent() { - // Given - User user = UserFixture.경제학과_20학번_편입(); - GraduationRequirement graduationRequirement = mock(GraduationRequirement.class); - given(findTakenLectureUseCase.findTakenLectures(user.getId())).willReturn(takenLectureInventory); - - // When - GraduationResult result = calculateGraduationService.calculateGraduation(user); - - // Then - assertThat(result).isNotNull(); - verify(findTakenLectureUseCase, times(1)).findTakenLectures(user.getId()); - verify(updateStudentInformationUseCase, times(1)).updateUser(any()); - } -} diff --git a/src/test/java/com/plzgraduate/myongjigraduatebe/graduation/application/service/CalculateMajorGraduationServiceTest.java b/src/test/java/com/plzgraduate/myongjigraduatebe/graduation/application/service/CalculateMajorGraduationServiceTest.java index 4827f388..de7aa4af 100644 --- a/src/test/java/com/plzgraduate/myongjigraduatebe/graduation/application/service/CalculateMajorGraduationServiceTest.java +++ b/src/test/java/com/plzgraduate/myongjigraduatebe/graduation/application/service/CalculateMajorGraduationServiceTest.java @@ -52,13 +52,13 @@ class CalculateMajorGraduationServiceTest { @BeforeEach void setUp() { MandatoryMajorManager mandatoryMajorManager = new MandatoryMajorManager( - List.of(new OptionalMandatoryMajorHandler(), new ReplaceMandatoryMajorHandler())); + List.of(new OptionalMandatoryMajorHandler(), new ReplaceMandatoryMajorHandler())); ElectiveMajorManager electiveMajorManager = new ElectiveMajorManager(); SubMajorGraduationManager subMajorGraduationManager = new SubMajorGraduationManager(); MajorGraduationManager majorGraduationManager = new MajorGraduationManager( - mandatoryMajorManager, electiveMajorManager); + mandatoryMajorManager, electiveMajorManager); calculateMajorGraduationService = new CalculateMajorGraduationService(findMajorPort, - majorGraduationManager, subMajorGraduationManager); + majorGraduationManager, subMajorGraduationManager); } @DisplayName("MAJOR 관련 카테고리 일때만 MajorGraduationService를 호출한다.") @@ -80,50 +80,50 @@ void shouldSupportMajorCategory() { void shouldCalculateSingleDetailGraduationIfPrimaryMandatory() { //given User user = User.builder() - .id(1L) - .primaryMajor("응용소프트웨어전공") - .entryYear(19) - .build(); + .id(1L) + .primaryMajor("응용소프트웨어전공") + .entryYear(19) + .build(); HashSet graduationMajorLectures = new HashSet<>( - Set.of( - MajorLecture.of(Lecture.builder() - .id("HEC01211") - .credit(3) - .build(), "응용소프트웨어전공", 1, 16, 23), - MajorLecture.of(Lecture.builder() - .id("HEC01204") - .credit(3) - .build(), "응용소프트웨어전공", 1, 16, 23))); + Set.of( + MajorLecture.of(Lecture.builder() + .id("HEC01211") + .credit(3) + .build(), "응용소프트웨어전공", 1, 16, 23), + MajorLecture.of(Lecture.builder() + .id("HEC01204") + .credit(3) + .build(), "응용소프트웨어전공", 1, 16, 23))); given(findMajorPort.findMajor(user.getPrimaryMajor())).willReturn(graduationMajorLectures); HashSet takenLectures = new HashSet<>( - Set.of( - TakenLecture.builder() - .lecture(Lecture.builder() - .id("HEC01211") //전공 필수 - .credit(3) - .build()) - .build(), - TakenLecture.builder() - .lecture(Lecture.builder() - .id("HEC01305") //전공 선택 - .credit(3) - .build()) - .build())); + Set.of( + TakenLecture.builder() + .lecture(Lecture.builder() + .id("HEC01211") //전공 필수 + .credit(3) + .build()) + .build(), + TakenLecture.builder() + .lecture(Lecture.builder() + .id("HEC01305") //전공 선택 + .credit(3) + .build()) + .build())); TakenLectureInventory takenLectureInventory = TakenLectureInventory.from(takenLectures); GraduationRequirement graduationRequirement = GraduationRequirement.builder() - .primaryMajorCredit(70) - .build(); + .primaryMajorCredit(70) + .build(); //when DetailGraduationResult detailPrimaryMandatoryMajorGraduationResult = calculateMajorGraduationService.calculateSingleDetailGraduation( - user, PRIMARY_MANDATORY_MAJOR, takenLectureInventory, graduationRequirement); + user, PRIMARY_MANDATORY_MAJOR, takenLectureInventory, graduationRequirement); //then assertThat(detailPrimaryMandatoryMajorGraduationResult) - .extracting("graduationCategory", "isCompleted", "totalCredit", "takenCredit") - .contains(PRIMARY_MANDATORY_MAJOR, false, 6, 3.0); + .extracting("graduationCategory", "isCompleted", "totalCredit", "takenCredit") + .contains(PRIMARY_MANDATORY_MAJOR, false, 6, 3.0); } @DisplayName("유저의 주전공선택 상세 졸업결과를 계산한다.") @@ -131,57 +131,57 @@ void shouldCalculateSingleDetailGraduationIfPrimaryMandatory() { void calculateSingleDetailGraduationIfPrimaryElective() { //given User user = User.builder() - .id(1L) - .primaryMajor("응용소프트웨어전공") - .entryYear(19) - .build(); + .id(1L) + .primaryMajor("응용소프트웨어전공") + .entryYear(19) + .build(); HashSet graduationMajorLectures = new HashSet<>( - Set.of( - // 전공 필수 - MajorLecture.of(Lecture.builder() - .id("HEC01211") - .credit(3) - .build(), "응용소프트웨어전공", 1, 16, 23), - // 전공 선택 - MajorLecture.of(Lecture.builder() - .id("HEC01305") - .credit(3) - .build(), "응용소프트웨어전공", 0, 16, 23), - // 전공 선택 - MajorLecture.of(Lecture.builder() - .id("HEC01318") - .credit(3) - .build(), "응용소프트웨어전공", 0, 16, 23))); + Set.of( + // 전공 필수 + MajorLecture.of(Lecture.builder() + .id("HEC01211") + .credit(3) + .build(), "응용소프트웨어전공", 1, 16, 23), + // 전공 선택 + MajorLecture.of(Lecture.builder() + .id("HEC01305") + .credit(3) + .build(), "응용소프트웨어전공", 0, 16, 23), + // 전공 선택 + MajorLecture.of(Lecture.builder() + .id("HEC01318") + .credit(3) + .build(), "응용소프트웨어전공", 0, 16, 23))); given(findMajorPort.findMajor(user.getPrimaryMajor())).willReturn(graduationMajorLectures); HashSet takenLectures = new HashSet<>( - Set.of( - TakenLecture.builder() - .lecture(Lecture.builder() - .id("HEC01211") //전공 필수 - .credit(3) - .build()) - .build(), - TakenLecture.builder() - .lecture(Lecture.builder() - .id("HEC01305") //전공 선택 - .credit(3) - .build()) - .build())); + Set.of( + TakenLecture.builder() + .lecture(Lecture.builder() + .id("HEC01211") //전공 필수 + .credit(3) + .build()) + .build(), + TakenLecture.builder() + .lecture(Lecture.builder() + .id("HEC01305") //전공 선택 + .credit(3) + .build()) + .build())); TakenLectureInventory takenLectureInventory = TakenLectureInventory.from(takenLectures); GraduationRequirement graduationRequirement = GraduationRequirement.builder() - .primaryMajorCredit(70) - .build(); + .primaryMajorCredit(70) + .build(); //when DetailGraduationResult detailPrimaryElectiveMajorGraduationResult = calculateMajorGraduationService.calculateSingleDetailGraduation( - user, PRIMARY_ELECTIVE_MAJOR, takenLectureInventory, graduationRequirement); + user, PRIMARY_ELECTIVE_MAJOR, takenLectureInventory, graduationRequirement); //then assertThat(detailPrimaryElectiveMajorGraduationResult) - .extracting("graduationCategory", "isCompleted", "totalCredit", "takenCredit") - .contains(PRIMARY_ELECTIVE_MAJOR, false, 67, 3.0); + .extracting("graduationCategory", "isCompleted", "totalCredit", "takenCredit") + .contains(PRIMARY_ELECTIVE_MAJOR, false, 67, 3.0); } @DisplayName("유저의 복수전공필수 졸업결과를 계산한다.") @@ -189,50 +189,50 @@ void calculateSingleDetailGraduationIfPrimaryElective() { void calculateSingleDetailGraduationIfDualMandatory() { //given User user = User.builder() - .id(1L) - .dualMajor("응용소프트웨어전공") - .entryYear(19) - .build(); + .id(1L) + .dualMajor("응용소프트웨어전공") + .entryYear(19) + .build(); HashSet graduationMajorLectures = new HashSet<>( - Set.of( - MajorLecture.of(Lecture.builder() - .id("HEC01211") - .credit(3) - .build(), "응용소프트웨어전공", 1, 16, 23), - MajorLecture.of(Lecture.builder() - .id("HEC01204") - .credit(3) - .build(), "응용소프트웨어전공", 1, 16, 23))); + Set.of( + MajorLecture.of(Lecture.builder() + .id("HEC01211") + .credit(3) + .build(), "응용소프트웨어전공", 1, 16, 23), + MajorLecture.of(Lecture.builder() + .id("HEC01204") + .credit(3) + .build(), "응용소프트웨어전공", 1, 16, 23))); given(findMajorPort.findMajor(user.getDualMajor())).willReturn(graduationMajorLectures); HashSet takenLectures = new HashSet<>( - Set.of( - TakenLecture.builder() - .lecture(Lecture.builder() - .id("HEC01211") //전공 필수 - .credit(3) - .build()) - .build(), - TakenLecture.builder() - .lecture(Lecture.builder() - .id("HEC01305") //전공 선택 - .credit(3) - .build()) - .build())); + Set.of( + TakenLecture.builder() + .lecture(Lecture.builder() + .id("HEC01211") //전공 필수 + .credit(3) + .build()) + .build(), + TakenLecture.builder() + .lecture(Lecture.builder() + .id("HEC01305") //전공 선택 + .credit(3) + .build()) + .build())); TakenLectureInventory takenLectureInventory = TakenLectureInventory.from(takenLectures); GraduationRequirement graduationRequirement = GraduationRequirement.builder() - .dualMajorCredit(70) - .build(); + .dualMajorCredit(70) + .build(); //when DetailGraduationResult detailDualMandatoryMajorGraduationResult = calculateMajorGraduationService.calculateSingleDetailGraduation( - user, DUAL_MANDATORY_MAJOR, takenLectureInventory, graduationRequirement); + user, DUAL_MANDATORY_MAJOR, takenLectureInventory, graduationRequirement); //then assertThat(detailDualMandatoryMajorGraduationResult) - .extracting("graduationCategory", "isCompleted", "totalCredit", "takenCredit") - .contains(DUAL_MANDATORY_MAJOR, false, 6, 3.0); + .extracting("graduationCategory", "isCompleted", "totalCredit", "takenCredit") + .contains(DUAL_MANDATORY_MAJOR, false, 6, 3.0); } @DisplayName("유저의 복수전공선택 졸업결과를 계산한다.") @@ -240,51 +240,52 @@ void calculateSingleDetailGraduationIfDualMandatory() { void calculateCoreCulture() { //given User user = User.builder() - .id(1L) - .dualMajor("응용소프트웨어전공") - .entryYear(19) - .build(); + .id(1L) + .dualMajor("응용소프트웨어전공") + .entryYear(19) + .build(); HashSet graduationMajorLectures = new HashSet<>( - Set.of( - MajorLecture.of(Lecture.builder() - .id("HEC01211") - .credit(3) - .build(), "응용소프트웨어전공", 1, 16, 23), - MajorLecture.of(Lecture.builder() - .id("HEC01304") - .credit(3) - .build(), "응용소프트웨어전공", 0, 16, 23))); + Set.of( + MajorLecture.of(Lecture.builder() + .id("HEC01211") + .credit(3) + .build(), "응용소프트웨어전공", 1, 16, 23), + MajorLecture.of(Lecture.builder() + .id("HEC01304") + .credit(3) + .build(), "응용소프트웨어전공", 0, 16, 23))); given(findMajorPort.findMajor(user.getDualMajor())).willReturn(graduationMajorLectures); HashSet takenLectures = new HashSet<>( - Set.of( - TakenLecture.builder() - .lecture(Lecture.builder() - .id("HEC01211") //전공 필수 - .credit(3) - .build()) - .build(), - TakenLecture.builder() - .lecture(Lecture.builder() - .id("HEC01304") //전공 선택 - .credit(3) - .build()) - .build())); + Set.of( + TakenLecture.builder() + .lecture(Lecture.builder() + .id("HEC01211") //전공 필수 + .credit(3) + .build()) + .build(), + TakenLecture.builder() + .lecture(Lecture.builder() + .id("HEC01304") //전공 선택 + .credit(3) + .build()) + .build())); TakenLectureInventory takenLectureInventory = TakenLectureInventory.from(takenLectures); GraduationRequirement graduationRequirement = GraduationRequirement.builder() - .dualMajorCredit(70) - .build(); + .dualMajorCredit(70) + .build(); //when DetailGraduationResult detailDualMandatoryMajorGraduationResult = calculateMajorGraduationService.calculateSingleDetailGraduation( - user, DUAL_ELECTIVE_MAJOR, takenLectureInventory, graduationRequirement); + user, DUAL_ELECTIVE_MAJOR, takenLectureInventory, graduationRequirement); //then assertThat(detailDualMandatoryMajorGraduationResult) - .extracting("graduationCategory", "isCompleted", "totalCredit", "takenCredit") - .contains(DUAL_ELECTIVE_MAJOR, false, 67, 3.0); + .extracting("graduationCategory", "isCompleted", "totalCredit", "takenCredit") + .contains(DUAL_ELECTIVE_MAJOR, false, 67, 3.0); } + @DisplayName("편입생 주전공필수 졸업결과를 계산한다.") @Test void calculateSingleDetailGraduationForTransferPrimaryMandatory() { @@ -337,57 +338,4 @@ void calculateSingleDetailGraduationForTransferPrimaryMandatory() { .contains(PRIMARY_MANDATORY_MAJOR, false, 6, 3.0); } -// @DisplayName("편입생 주전공선택 졸업결과를 계산한다.") -// @Test -// void calculateSingleDetailGraduationForTransferPrimaryElective() { -// // given -// User user = User.builder() -// .id(1L) -// .primaryMajor("응용소프트웨어전공") -// .entryYear(19) -// .studentCategory(StudentCategory.TRANSFER) -// .transferCredit(TransferCredit.from("0/15/0/0")) // 15 전공 선택 학점 -// .build(); -// -// HashSet graduationMajorLectures = new HashSet<>( -// Set.of( -// // 전공 필수 -// MajorLecture.of(Lecture.builder() -// .id("HEC01211") -// .credit(3) -// .build(), "응용소프트웨어전공", 1, 16, 23), -// // 전공 선택 -// MajorLecture.of(Lecture.builder() -// .id("HEC01305") -// .credit(3) -// .build(), "응용소프트웨어전공", 0, 16, 23) -// ) -// ); -// given(findMajorPort.findMajor(user.getPrimaryMajor())).willReturn(graduationMajorLectures); -// -// HashSet takenLectures = new HashSet<>( -// Set.of( -// TakenLecture.builder() -// .lecture(Lecture.builder() -// .id("HEC01305") // 전공 선택 -// .credit(3) -// .build()) -// .build() -// ) -// ); -// TakenLectureInventory takenLectureInventory = TakenLectureInventory.from(takenLectures); -// -// GraduationRequirement graduationRequirement = GraduationRequirement.builder() -// .primaryMajorCredit(70) // 전공 학점 총합 -// .build(); -// -// // when -// DetailGraduationResult detailPrimaryElectiveMajorGraduationResult = calculateMajorGraduationService.calculateSingleDetailGraduation( -// user, PRIMARY_ELECTIVE_MAJOR, takenLectureInventory, graduationRequirement); -// -// // then -// assertThat(detailPrimaryElectiveMajorGraduationResult) -// .extracting("graduationCategory", "isCompleted", "totalCredit", "takenCredit") -// .contains(PRIMARY_ELECTIVE_MAJOR, true, 64, 18.0); // 15 (편입 학점) + 3 (수강 학점) -// } } \ No newline at end of file