RestAssured
์ํฉ
MockMvc์ ํ๊ณ
์์ ์ฝ๋
@Sql(statements = "insert into organization (title) values ('eojjeogojeojjeogo')")
@DisplayName("๋ง์ผ ์คํค ์์ ์์ฒญํ๋ฉด 200 ์ฝ๋๋ฅผ ์๋ตํ๋ค")
@Test
void updateMilestone() throws Exception {
// given
long milestoneId = milestoneService.create(ORGANIZATION_TITLE, createMileStoneRequest);
MilestoneRequest changedMilestoneRequest = new MilestoneRequest(TEST_TITLE, TEST_DESCRIPTION,
TEST_DUE_DATE);
// when
mockMvc.perform(patch("/api/" + ORGANIZATION_TITLE + "/milestones/" + milestoneId)
.content(objectMapper.writeValueAsString(changedMilestoneRequest))
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON)
)
// then
.andDo(print())
.andExpect(status().isOk());
}ํด๊ฒฐ ๋ฐฉ๋ฒ
RestAssured์ Cucumber์ ๋น๊ต
RestAssured์ ์ฅ์
๋ด๊ฐ ์ ํํ ๋ฐฉ๋ฒ๊ณผ ์ด์
๊ฒฐ๊ณผ
Last updated