Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[개선] 수험번호 기준 변경 #157

Merged
merged 2 commits into from
Oct 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@ private Long getNextExaminationNumber(FormType type) {
}

private Long getStartNumber(FormType type) {
return switch (type.getMainCategory()) {
case REGULAR -> 2000L;
case SPECIAL -> 3000L;
return switch (type.getCategory()) {
case REGULAR -> 1000L;
case MEISTER_TALENT -> 2000L;
case SOCIAL_INTEGRATION -> 3000L;
case SUPERNUMERARY -> 4000L;
default -> 0L;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;

import javax.swing.text.html.Option;

import java.util.Optional;

import static org.junit.jupiter.api.Assertions.*;
Expand All @@ -31,14 +29,14 @@ class AssignExaminationNumberServiceTest {
void 수험번호를_부여한다() {
// given
Form form = FormFixture.createForm(FormType.REGULAR);
given(formRepository.findMaxExaminationNumber(2000L, 3000L)).willReturn(Optional.of(2005L));
given(formRepository.findMaxExaminationNumber(1000L, 2000L)).willReturn(Optional.of(1005L));

// when
assignExaminationNumberService.execute(form);

// then
assertEquals(2006L, form.getExaminationNumber());
verify(formRepository).findMaxExaminationNumber(2000L, 3000L);
assertEquals(1006L, form.getExaminationNumber());
verify(formRepository).findMaxExaminationNumber(1000L, 2000L);
}

@Test
Expand Down
Loading