Skip to content

Commit a6609d9

Browse files
authored
테스트 코드 수정 (#13)
* Test: 테스트용 application.yml 파일 추가 * Feat: Dockerfile 작성 * Refactor: AI 요구사항에 맞게 코드 수정 * Fix: H2 관련 설정 삭제 * Refactor: 식당 ID를 반환하도록 추가 * Refactor: AI 요구사항에 맞춰 수정 * Refactor: AI 요구사항에 맞도록 수정 * Test: 테스트 코드 수정
1 parent 529c471 commit a6609d9

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/test/java/workplate/workplateserver/work/controller/WorkControllerTest.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import com.google.gson.Gson;
3131

3232
import workplate.workplateserver.auth.domain.MainExperience;
33+
import workplate.workplateserver.auth.domain.PhysicalStatus;
3334
import workplate.workplateserver.auth.domain.SubExperience;
3435
import workplate.workplateserver.auth.domain.entity.Member;
3536
import workplate.workplateserver.auth.domain.jwt.JwtTokenProvider;
@@ -76,9 +77,9 @@ class WorkControllerTest {
7677
@WithMockUser
7778
void findAllTest() throws Exception {
7879
// Given
79-
WorkResponse r1 = new WorkResponse("경비", "병원을 경비합니다.", 10000L, MainExperience.SERVICE, SubExperience.SECURITY_GUARD);
80-
WorkResponse r2 = new WorkResponse("주간경비", "병원을 주간에 경비합니다.", 11000L, MainExperience.SERVICE, SubExperience.SECURITY_GUARD);
81-
WorkResponse r3 = new WorkResponse("야간경비", "병원을 야간에 경비합니다.", 12000L, MainExperience.SERVICE, SubExperience.SECURITY_GUARD);
80+
WorkResponse r1 = new WorkResponse("경비", "병원을 경비합니다.", 10000L, "서울", MainExperience.SERVICE, SubExperience.SECURITY_GUARD, PhysicalStatus.NORMAL);
81+
WorkResponse r2 = new WorkResponse("주간경비", "병원을 주간에 경비합니다.", 11000L, "서울", MainExperience.SERVICE, SubExperience.SECURITY_GUARD, PhysicalStatus.NORMAL);
82+
WorkResponse r3 = new WorkResponse("야간경비", "병원을 야간에 경비합니다.", 12000L, "서울", MainExperience.SERVICE, SubExperience.SECURITY_GUARD, PhysicalStatus.NORMAL);
8283
PageResponse<WorkResponse> response = new PageResponse<>(List.of(r1, r2, r3));
8384
given(workService.findAll(any())).willReturn(response);
8485

@@ -104,6 +105,8 @@ void findAllTest() throws Exception {
104105
fieldWithPath("data.content[].workName").description("소일거리 이름"),
105106
fieldWithPath("data.content[].workDetail").description("소일거리 상세 내용"),
106107
fieldWithPath("data.content[].workCredit").description("소일거리 시급"),
108+
fieldWithPath("data.content[].location").description("소일거리 위치"),
109+
fieldWithPath("data.content[].physicalStatus").description("소일거리 건강상태"),
107110
fieldWithPath("data.content[].mainCategory").description("소일거리 메인카테고리"),
108111
fieldWithPath("data.content[].subCategory").description("소일거리 서브카테고리"),
109112
fieldWithPath("data.pageNum").description("현재 페이지 번호"),
@@ -121,7 +124,7 @@ void findAllTest() throws Exception {
121124
@WithMockUser
122125
void findByIdTest() throws Exception {
123126
// Given
124-
WorkResponse r1 = new WorkResponse("경비", "병원을 경비합니다.", 10000L, MainExperience.SERVICE, SubExperience.SECURITY_GUARD);
127+
WorkResponse r1 = new WorkResponse("경비", "병원을 경비합니다.", 10000L, "서울", MainExperience.SERVICE, SubExperience.SECURITY_GUARD, PhysicalStatus.NORMAL);
125128
given(workService.findById(1L)).willReturn(r1);
126129

127130
// When
@@ -145,6 +148,8 @@ void findByIdTest() throws Exception {
145148
fieldWithPath("data.workName").description("소일거리 이름"),
146149
fieldWithPath("data.workDetail").description("소일거리 상세 내용"),
147150
fieldWithPath("data.workCredit").description("소일거리 시급"),
151+
fieldWithPath("data.location").description("소일거리 위치"),
152+
fieldWithPath("data.physicalStatus").description("소일거리 건강상태"),
148153
fieldWithPath("data.mainCategory").description("소일거리 메인카테고리"),
149154
fieldWithPath("data.subCategory").description("소일거리 서브카테고리")
150155
)));

0 commit comments

Comments
 (0)