Skip to content

Commit

Permalink
fix: fix code smells
Browse files Browse the repository at this point in the history
  • Loading branch information
stophwan committed Jun 13, 2024
1 parent cb787a6 commit 6a0f20f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.plzgraduate.myongjigraduatebe.takenlecture.domain.model.TakenLectureInventory;

public class ElectiveMajorManager {
private static final String ELECTIVE_MAJOR_NAME = "전공선택";
public DetailCategoryResult createDetailCategoryResult(TakenLectureInventory takenLectureInventory,
Set<Lecture> electiveLectures, int electiveMajorTotalCredit) {
Set<Lecture> takenElective = new HashSet<>();
Expand All @@ -19,7 +20,7 @@ public DetailCategoryResult createDetailCategoryResult(TakenLectureInventory tak
finishedTakenLecture.add(takenLecture);
takenElective.add(takenLecture.getLecture());
});
DetailCategoryResult electiveMajorResult = DetailCategoryResult.create("전공선택", true, electiveMajorTotalCredit);
DetailCategoryResult electiveMajorResult = DetailCategoryResult.create(ELECTIVE_MAJOR_NAME, true, electiveMajorTotalCredit);
electiveMajorResult.calculate(takenElective, electiveLectures);
takenLectureInventory.handleFinishedTakenLectures(finishedTakenLecture);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import java.util.Set;

import com.plzgraduate.myongjigraduatebe.graduation.domain.model.DetailCategoryResult;
import com.plzgraduate.myongjigraduatebe.graduation.domain.model.GraduationCategory;
import com.plzgraduate.myongjigraduatebe.lecture.domain.model.Lecture;
import com.plzgraduate.myongjigraduatebe.takenlecture.domain.model.TakenLecture;
import com.plzgraduate.myongjigraduatebe.user.domain.model.User;
Expand All @@ -15,7 +16,7 @@
@RequiredArgsConstructor
public class MandatoryMajorManager {

private static final String detailCategoryName = "전공필수";
private static final String MANDATORY_MAJOR_NAME = "전공필수";

private final List<MandatoryMajorSpecialCaseHandler> mandatoryMajorSpecialCaseHandlers;

Expand All @@ -42,7 +43,7 @@ public DetailCategoryResult createDetailCategoryResult(User user, TakenLectureIn
finishedTakenLecture.add(takenLecture);
takenMandatory.add(takenLecture.getLecture());
});
DetailCategoryResult majorMandatoryResult = DetailCategoryResult.create(detailCategoryName, isSatisfiedMandatory,
DetailCategoryResult majorMandatoryResult = DetailCategoryResult.create(MANDATORY_MAJOR_NAME, isSatisfiedMandatory,
calculateTotalCredit(takenMandatory, mandatoryLectures, removeMandatoryTotalCredit));
majorMandatoryResult.calculate(takenMandatory, mandatoryLectures);
takenLectureInventory.handleFinishedTakenLectures(finishedTakenLecture);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package com.plzgraduate.myongjigraduatebe.graduation.domain.service.major;

import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.*;

import java.util.HashSet;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@

import com.plzgraduate.myongjigraduatebe.fixture.LectureFixture;
import com.plzgraduate.myongjigraduatebe.fixture.UserFixture;
import com.plzgraduate.myongjigraduatebe.graduation.domain.service.major.MandatoryMajorSpecialCaseHandler;
import com.plzgraduate.myongjigraduatebe.graduation.domain.service.major.MandatorySpecialCaseInformation;
import com.plzgraduate.myongjigraduatebe.graduation.domain.service.major.ReplaceMandatoryMandatoryMajorHandler;
import com.plzgraduate.myongjigraduatebe.lecture.domain.model.Lecture;
import com.plzgraduate.myongjigraduatebe.takenlecture.domain.model.Semester;
import com.plzgraduate.myongjigraduatebe.takenlecture.domain.model.TakenLecture;
Expand Down

0 comments on commit 6a0f20f

Please sign in to comment.