Skip to content

Commit

Permalink
remove: 불필요 테스트코드 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
KEEKE132 committed Jun 1, 2024
1 parent 30b92b1 commit c0feede
Showing 1 changed file with 1 addition and 33 deletions.
34 changes: 1 addition & 33 deletions src/test/java/se/issuetrackingsystem/IssueServiceTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -64,38 +64,6 @@ void issueCreate() {
assertEquals(result.getProject(), project);
}

@Test
@DisplayName("이슈 생성 실패-프로젝트_없음")
void issueCreateNoProject() {
//given
Project project = mock(Project.class);
User user = mock(User.class);

when(projectRepository.findById(project.getId())).thenReturn(Optional.empty());
when(userRepository.findById(user.getId())).thenReturn(Optional.of(user));
when(issueRepository.save(any(Issue.class))).thenAnswer(i -> i.getArgument(0));

//when then
assertThrows(CustomException.class,
()-> issueService.create(project.getId(), "Issue1", "issue", user.getId(), Issue.Priority.MINOR));
}

@Test
@DisplayName("이슈 생성 실패-리포터_없음")
void issueCreateNoReporter() {
//given
Project project = mock(Project.class);
User user = mock(User.class);

when(projectRepository.findById(project.getId())).thenReturn(Optional.of(project));
when(userRepository.findById(user.getId())).thenReturn(Optional.empty());
when(issueRepository.save(any(Issue.class))).thenAnswer(i -> i.getArgument(0));

//when then
assertThrows(CustomException.class,
()-> issueService.create(project.getId(), "Issue1", "issue", user.getId(), Issue.Priority.MINOR));
}

@Test
@DisplayName("이슈 생성 실패-Tester아님")
void issueCreateNotTester() {
Expand Down Expand Up @@ -254,7 +222,7 @@ void issueDelete() {
}

@Test
@DisplayName("이슈 삭제 실패-Tester")
@DisplayName("이슈 삭제 실패-Tester 아님")
void issueDeleteNotTester() {
//given
Issue issue = mock(Issue.class);
Expand Down

0 comments on commit c0feede

Please sign in to comment.