Skip to content

Commit

Permalink
Merge pull request #33 from neorang/cje614/add_isr_test
Browse files Browse the repository at this point in the history
add: Issue Test 작성
  • Loading branch information
clemado1 authored Oct 24, 2022
2 parents 93d9193 + 61bad59 commit 34f2b54
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 34f2b54

Please sign in to comment.