Skip to content

Commit

Permalink
[chore] chaining method를 보기 편하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyeon-Uk committed Aug 11, 2024
1 parent f34aed0 commit 30c80ab
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ void successTest() throws Exception {
PayAccountChargeRequest command = new PayAccountChargeRequest(amount);

//when & then
mvc.perform(post(BASE_URL + payAccount.getId() + "/charge").contentType(MediaType.APPLICATION_JSON_VALUE)
mvc.perform(post(BASE_URL + payAccount.getId() + "/charge")
.contentType(MediaType.APPLICATION_JSON_VALUE)
.content(objectMapper.writeValueAsBytes(command)))
.andExpect(status().isOk())
.andExpect(jsonPath("$.balance").value(amount + originBalance));
Expand All @@ -87,7 +88,8 @@ void notExistsAccountIdTest() throws Exception {
PayAccountChargeRequest command = new PayAccountChargeRequest(amount);

//when & then
mvc.perform(post(BASE_URL + notExistsId + "/charge").contentType(MediaType.APPLICATION_JSON_VALUE)
mvc.perform(post(BASE_URL + notExistsId + "/charge")
.contentType(MediaType.APPLICATION_JSON_VALUE)
.content(objectMapper.writeValueAsBytes(command)))
.andExpect(status().isNotFound());
}
Expand All @@ -99,7 +101,8 @@ void nullAmountTest() throws Exception {
PayAccountChargeRequest command = new PayAccountChargeRequest(null);

//when & then
mvc.perform(post(BASE_URL + payAccount.getId() + "/charge").contentType(MediaType.APPLICATION_JSON_VALUE)
mvc.perform(post(BASE_URL + payAccount.getId() + "/charge")
.contentType(MediaType.APPLICATION_JSON_VALUE)
.content(objectMapper.writeValueAsBytes(command)))
.andExpect(status().isBadRequest());

Expand All @@ -114,7 +117,8 @@ void negativeAmountTest() throws Exception {
PayAccountChargeRequest command = new PayAccountChargeRequest(amount);

//when & then
mvc.perform(post(BASE_URL + payAccount.getId() + "/charge").contentType(MediaType.APPLICATION_JSON_VALUE)
mvc.perform(post(BASE_URL + payAccount.getId() + "/charge")
.contentType(MediaType.APPLICATION_JSON_VALUE)
.content(objectMapper.writeValueAsBytes(command)))
.andExpect(status().isBadRequest());

Expand Down

0 comments on commit 30c80ab

Please sign in to comment.