From 61bad59b8b4030ffea3d07cb796c635601f750ba Mon Sep 17 00:00:00 2001 From: cje614 Date: Fri, 21 Oct 2022 13:54:46 +0900 Subject: [PATCH] =?UTF-8?q?add:=20Issue=20Test=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../neims/issue/service/IssueServiceTest.java | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/src/test/java/com/neorang/neims/issue/service/IssueServiceTest.java b/src/test/java/com/neorang/neims/issue/service/IssueServiceTest.java index e76d86c..84b35ff 100644 --- a/src/test/java/com/neorang/neims/issue/service/IssueServiceTest.java +++ b/src/test/java/com/neorang/neims/issue/service/IssueServiceTest.java @@ -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(); + } } \ No newline at end of file