Skip to content

Commit

Permalink
Merge pull request #157 from Bamdoliro/perf/#150
Browse files Browse the repository at this point in the history
[개선] 수험번호 기준 변경
  • Loading branch information
jyj1289 authored Oct 12, 2024
2 parents 4e0edb2 + de81e22 commit 0bbd6c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
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

0 comments on commit 0bbd6c6

Please sign in to comment.