From fdbe5bc5a21f1c3c9510bfaf635aab88fd7fb4e8 Mon Sep 17 00:00:00 2001 From: ansm6 Date: Wed, 22 Feb 2023 16:47:29 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A7=A4=EB=84=88=20=EB=A6=AC=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=A1=B0=ED=9A=8C=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?= =?UTF-8?q?=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ller.java => MannerRetriveController.java} | 2 +- .../service/MannerRetriveServiceTest.java | 40 +++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) rename src/main/java/com/gaaji/auth/controller/{RetriveMannerListController.java => MannerRetriveController.java} (96%) create mode 100644 src/test/java/com/gaaji/auth/service/MannerRetriveServiceTest.java diff --git a/src/main/java/com/gaaji/auth/controller/RetriveMannerListController.java b/src/main/java/com/gaaji/auth/controller/MannerRetriveController.java similarity index 96% rename from src/main/java/com/gaaji/auth/controller/RetriveMannerListController.java rename to src/main/java/com/gaaji/auth/controller/MannerRetriveController.java index 0160e2e..62240bc 100644 --- a/src/main/java/com/gaaji/auth/controller/RetriveMannerListController.java +++ b/src/main/java/com/gaaji/auth/controller/MannerRetriveController.java @@ -15,7 +15,7 @@ @RequestMapping("/manner") @RequiredArgsConstructor @RestController -public class RetriveMannerListController { +public class MannerRetriveController { private final MannerRetriveService mannerRetriveService; diff --git a/src/test/java/com/gaaji/auth/service/MannerRetriveServiceTest.java b/src/test/java/com/gaaji/auth/service/MannerRetriveServiceTest.java new file mode 100644 index 0000000..a2a4c55 --- /dev/null +++ b/src/test/java/com/gaaji/auth/service/MannerRetriveServiceTest.java @@ -0,0 +1,40 @@ +package com.gaaji.auth.service; + +import static org.assertj.core.api.Assertions.assertThat; + +import java.util.List; + +import org.junit.jupiter.api.Test; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.GetMapping; + +import com.gaaji.auth.applicationservice.MannerRetriveService; +import com.gaaji.auth.applicationservice.MannerRetriveServiceImpl; +import com.gaaji.auth.domain.BadManner; +import com.gaaji.auth.domain.GoodManner; + +public class MannerRetriveServiceTest { + + @Test + void 매너리스트테스트() { + MannerRetriveService mannerRetriveService = new MannerRetriveServiceImpl(); + + //good + List goodMannerList = mannerRetriveService.retriveGoodMannerList(); + int i= 1; + for(GoodManner goodManner: goodMannerList) { + assertThat(goodManner.name()).isEqualTo("gm"+i); + assertThat(goodManner.getMannerContents()).isEqualTo(GoodManner.valueOf("gm"+i).getMannerContents()); + i++; + } + //bad + + List badMannerList = mannerRetriveService.retriveBadMannerList(); + i= 1; + for(BadManner badManner: badMannerList) { + assertThat(badManner.name()).isEqualTo("bm"+i); + assertThat(badManner.getMannerContents()).isEqualTo(BadManner.valueOf("bm"+i).getMannerContents()); + i++; + } + } +}