From 94c1e0234f7e6d9d2a34c074dbe17e9d4df050cf Mon Sep 17 00:00:00 2001 From: chaeyoungeee Date: Sun, 28 Jul 2024 18:53:10 +0900 Subject: [PATCH] =?UTF-8?q?test:=20=EB=AC=B8=ED=99=94=20=EC=83=81=EC=84=B8?= =?UTF-8?q?=20=EC=A0=95=EB=B3=B4=20=EC=A1=B0=ED=9A=8C=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../culture/CultureCategoryServiceTest.java | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 src/test/java/likelion/MZConnent/service/culture/CultureCategoryServiceTest.java diff --git a/src/test/java/likelion/MZConnent/service/culture/CultureCategoryServiceTest.java b/src/test/java/likelion/MZConnent/service/culture/CultureCategoryServiceTest.java new file mode 100644 index 0000000..d0b1444 --- /dev/null +++ b/src/test/java/likelion/MZConnent/service/culture/CultureCategoryServiceTest.java @@ -0,0 +1,47 @@ +package likelion.MZConnent.service.culture; + +import likelion.MZConnent.dto.culture.response.CultureCategoryResponse; +import likelion.MZConnent.dto.culture.response.CultureDetailResponse; +import likelion.MZConnent.repository.member.MemberRepository; +import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.test.context.SpringBootTest; + +@Slf4j +@SpringBootTest +class CultureCategoryServiceTest { + @Autowired + CultureCategoryService cultureCategoryService; + + @Autowired + MemberRepository memberRepository; + + @Autowired + CultureService cultureService; + + @Test + public void getCultureCategory() throws Exception { + //given + + //when + CultureCategoryResponse all = cultureCategoryService.getAllCultureCategories(); + + //then + Assertions.assertEquals(all.getCultureCategories().size(), 5); + } + + @Test + public void getCultureDetailInfo() throws Exception { + //given + Long cultureId = 1L; + + //when + CultureDetailResponse cultureDetailInfo = cultureService.getCultureDetailInfo(cultureId); + + //then + log.info("문화: {}", cultureDetailInfo); + Assertions.assertEquals(cultureDetailInfo.getCultureId(), 1L); + } +} \ No newline at end of file