Skip to content

Commit

Permalink
매너 리스트 조회 테스트 완료
Browse files Browse the repository at this point in the history
  • Loading branch information
ansm6 committed Feb 22, 2023
1 parent 84023b0 commit fdbe5bc
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
@RequestMapping("/manner")
@RequiredArgsConstructor
@RestController
public class RetriveMannerListController {
public class MannerRetriveController {

private final MannerRetriveService mannerRetriveService;

Expand Down
40 changes: 40 additions & 0 deletions src/test/java/com/gaaji/auth/service/MannerRetriveServiceTest.java
Original file line number Diff line number Diff line change
@@ -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<GoodManner> 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<BadManner> 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++;
}
}
}

0 comments on commit fdbe5bc

Please sign in to comment.