Skip to content

Commit

Permalink
docs: 이벤트 재오픈 api 문서화
Browse files Browse the repository at this point in the history
Juhongseok committed Nov 24, 2023
1 parent c8085a0 commit a61d288
Showing 2 changed files with 46 additions and 1 deletion.
13 changes: 13 additions & 0 deletions src/docs/asciidoc/mentor.adoc
Original file line number Diff line number Diff line change
@@ -48,6 +48,19 @@ include::{snippets}/event/update/path-parameters.adoc[]
include::{snippets}/event/update/http-response.adoc[]
include::{snippets}/event/update/response-fields.adoc[]

=== 첨삭 이벤트 재오픈

include::{snippets}/event/reopen/exception-response.adoc[]

*Request*
include::{snippets}/event/reopen/http-request.adoc[]
include::{snippets}/event/reopen/path-parameters.adoc[]

*Response*
include::{snippets}/event/reopen/http-response.adoc[]
include::{snippets}/event/reopen/response-fields.adoc[]


=== 첨삭 이벤트 조회

include::{snippets}/user/mentor/events/exception-response.adoc[]
Original file line number Diff line number Diff line change
@@ -173,7 +173,6 @@ void setUp() {
);
EventUpdateRequest.EventInfoRequest eventInfoRequest = new EventUpdateRequest.EventInfoRequest("title", "content", 3);
EventUpdateRequest eventUpdateRequest = new EventUpdateRequest(eventInfoRequest, eventTimeRequest, List.of("BACK", "FRONT"));
/* 로그인 기능 완료 후 멘토 주입 값 추후 변경 예정 */
EventUpdateVo vo = eventUpdateRequest.toVo(1L);

doNothing().when(eventService).update(vo);
@@ -210,6 +209,39 @@ void setUp() {
);
}

@Test
@WithMockCustomUser
void 첨삭_이벤트_재오픈에_성공한다() throws Exception {
// given
EventUpdateRequest eventUpdateRequest = new EventUpdateRequest(null, null, null);
EventUpdateVo vo = eventUpdateRequest.toVo(1L);

doNothing().when(eventService).update(vo);

// when
ResultActions result = mvc.perform(patch("/api/v1/events/{eventId}", 1L)
.contentType(MediaType.APPLICATION_JSON)
.content(toJson(eventUpdateRequest)));

// then
result
.andExpect(status().isOk())
.andDo(
document("event/reopen",
getDocumentRequest(),
getDocumentResponse(),
nullableHttpRequestSnippet(),
exceptionResponse(List.of(NO_EMPTY_VALUE.name(), EVENT_NOT_FOUND.name(), NO_EMPTY_VALUE.name(), RANGE_MAXIMUM_ATTENDEE.name(), TIME_ERROR.name())),
pathParameters(
parameterWithName("eventId").description("수정할 이벤트 아이디")
),
responseFields(
fieldWithPath("id").type(NUMBER).description("수정된 첨삭 이벤트 아이디")
)
)
);
}

@Test
void 첨삭_이벤트_신청을_반려한다() throws Exception {
// given

0 comments on commit a61d288

Please sign in to comment.