Skip to content

Commit

Permalink
add: Issue Test 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
cje614 committed Oct 21, 2022
1 parent 93d9193 commit 61bad59
Showing 1 changed file with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,39 @@ void regist() {
Assertions.assertThat(created.getTitle()).isEqualTo("request_test");

}

@Test
void update() {
//given
Issue issue = issueService.findById(1L);

IssueForm form = IssueForm.builder()
.issueId(issue.getIssueId())
.type(Type.BUG)
.status(issue.getStatus())
.title(issue.getTitle() + "1")
.description(issue.getDescription())
.build();

//when
Issue updated = issueService.update(form);

//then
Assertions.assertThat(updated.getIssueId()).isEqualTo(issue.getIssueId());
Assertions.assertThat(updated.getTitle()).isNotEqualTo(issue.getTitle());
Assertions.assertThat(updated.getType()).isNotEqualTo(issue.getType());
}

@Test
void delete(){
//given
Issue issue = issueService.findById(1L);

//when
issueService.delete(issue.getIssueId());
Issue deleted = issueService.findById(1L);

//then
Assertions.assertThat(deleted).isNull();
}
}

0 comments on commit 61bad59

Please sign in to comment.