Skip to content

Commit

Permalink
test: 문화 상세 정보 조회 테스트 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
chaeyoungeee committed Jul 28, 2024
1 parent f98e1b7 commit 94c1e02
Showing 1 changed file with 47 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -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);
}
}

0 comments on commit 94c1e02

Please sign in to comment.