Skip to content

Commit

Permalink
[fix] @Valid 옵션에 맞게 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
AreSain committed Mar 23, 2024
1 parent 59674bc commit 5957c5c
Showing 1 changed file with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public void success() throws Exception {
//given
TemplateAdminCreateReqDto templateAdminCreateReqDto = new TemplateAdminCreateReqDto(
testCategory.getId(), "gameName", 4, 2,
180, 180, "genre", "difficulty", "summary");
180, 180, "genre", "hard", "summary");
String jsonRequest = objectMapper.writeValueAsString(templateAdminCreateReqDto);
//when
String contentAsString = mockMvc.perform(post(url)
Expand All @@ -101,7 +101,7 @@ public void fail() throws Exception {
//given
TemplateAdminCreateReqDto templateAdminCreateReqDto = new TemplateAdminCreateReqDto(
10L, "gameName", 4, 2,
180, 180, "genre", "difficulty", "summary");
180, 180, "genre", "hard", "summary");
String jsonRequest = objectMapper.writeValueAsString(templateAdminCreateReqDto);
//when && then
String contentAsString = mockMvc.perform(post(url)
Expand All @@ -122,7 +122,7 @@ void beforeEach() {
userAccessToken = tokenProvider.createToken(userTester.getId());
testCategory = testDataUtils.createNewCategory("category");
testTemplate = testDataUtils.createTemplate(testCategory, "gameName", 4,
2, 180, 180, "genre", "difficulty", "summary");
2, 180, 180, "genre", "hard", "summary");
}

/**
Expand All @@ -138,7 +138,7 @@ public void success() throws Exception {
Category newTestCategory = testDataUtils.createNewCategory("newCate");
TemplateAdminUpdateReqDto templateAdminUpdateReqDto = new TemplateAdminUpdateReqDto(
newTestCategory.getId(), "newGameName", 8, 4,
90, 90, "newGenre", "newDifficulty", "newSummary");
90, 90, "newGenre", "easy", "newSummary");
String jsonRequest = objectMapper.writeValueAsString(templateAdminUpdateReqDto);
//when
String contentAsString = mockMvc.perform(patch(url)
Expand All @@ -155,7 +155,7 @@ public void success() throws Exception {
assertThat(testTemplate.getMaxGameTime()).isEqualTo(90);
assertThat(testTemplate.getMinGameTime()).isEqualTo(90);
assertThat(testTemplate.getGenre()).isEqualTo("newGenre");
assertThat(testTemplate.getDifficulty()).isEqualTo("newDifficulty");
assertThat(testTemplate.getDifficulty()).isEqualTo("easy");
assertThat(testTemplate.getSummary()).isEqualTo("newSummary");
}

Expand All @@ -167,7 +167,7 @@ public void noCategoryFail() throws Exception {
//given
TemplateAdminUpdateReqDto templateAdminUpdateReqDto = new TemplateAdminUpdateReqDto(
10L, "newGameName", 8, 4,
90, 90, "newGenre", "newDifficulty", "newSummary");
90, 90, "newGenre", "easy", "newSummary");
String jsonRequest = objectMapper.writeValueAsString(templateAdminUpdateReqDto);
//when && then
String contentAsString = mockMvc.perform(patch(url)
Expand All @@ -186,7 +186,7 @@ public void noTemplateFail() throws Exception {
Category newTestCategory = testDataUtils.createNewCategory("newCate");
TemplateAdminUpdateReqDto templateAdminUpdateReqDto = new TemplateAdminUpdateReqDto(
newTestCategory.getId(), "newGameName", 8, 4,
90, 90, "newGenre", "newDifficulty", "newSummary");
90, 90, "newGenre", "easy", "newSummary");
String jsonRequest = objectMapper.writeValueAsString(templateAdminUpdateReqDto);
//when && then
String contentAsString = mockMvc.perform(patch(url)
Expand All @@ -207,7 +207,7 @@ void beforeEach() {
userAccessToken = tokenProvider.createToken(userTester.getId());
testCategory = testDataUtils.createNewCategory("category");
testTemplate = testDataUtils.createTemplate(testCategory, "gameName", 4,
2, 180, 180, "genre", "difficulty", "summary");
2, 180, 180, "genre", "hard", "summary");
}

/**
Expand Down

0 comments on commit 5957c5c

Please sign in to comment.