Skip to content

Commit

Permalink
Merge pull request #320 from 2022-bancow-teamProject/feature/Siyeon
Browse files Browse the repository at this point in the history
[TEST] Delete Buyer List
  • Loading branch information
lowgiant authored Feb 13, 2022
2 parents 52df490 + f11463e commit 250b8bc
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 0 deletions.
34 changes: 34 additions & 0 deletions spring/src/docs/asciidoc/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1246,7 +1246,41 @@ include::{snippets}/buyer-controller-test/edit-buyer/response-body.adoc[]
==== Response Fields
include::{snippets}/buyer-controller-test/edit-buyer/response-fields.adoc[]

[[구매자-한개만-삭제]]
=== 구매자 한개만 삭제
==== Curl Request
include::{snippets}/buyer-controller-test/delete-buyer-one/curl-request.adoc[]
==== Http Request
include::{snippets}/buyer-controller-test/delete-buyer-one/http-request.adoc[]
==== Http Response
include::{snippets}/buyer-controller-test/delete-buyer-one/http-response.adoc[]
==== Httpie Request
include::{snippets}/buyer-controller-test/delete-buyer-one/httpie-request.adoc[]
==== Request Header
include::{snippets}/buyer-controller-test/delete-buyer-one/request-headers.adoc[]
==== Path Parameters
include::{snippets}/buyer-controller-test/delete-buyer-one/path-parameters.adoc[]
==== Response Body
include::{snippets}/buyer-controller-test/delete-buyer-one/response-body.adoc[]
==== Response Fields
include::{snippets}/buyer-controller-test/delete-buyer-one/response-fields.adoc[]

[[구매자-선택-삭제]]
=== 구매자 선택 삭제
==== Curl Request
include::{snippets}/buyer-controller-test/delete-buyer-List/curl-request.adoc[]
==== Http Request
include::{snippets}/buyer-controller-test/delete-buyer-List/http-request.adoc[]
==== Http Response
include::{snippets}/buyer-controller-test/delete-buyer-List/http-response.adoc[]
==== Httpie Request
include::{snippets}/buyer-controller-test/delete-buyer-List/httpie-request.adoc[]
==== Request Header
include::{snippets}/buyer-controller-test/delete-buyer-List/request-headers.adoc[]
==== Response Body
include::{snippets}/buyer-controller-test/delete-buyer-List/response-body.adoc[]
==== Response Fields
include::{snippets}/buyer-controller-test/delete-buyer-List/response-fields.adoc[]

[[자주묻는질문]]
== 자주묻는질문
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,35 @@ void deleteBuyerOne() throws Exception {
;
}

@Test
@Transactional
void deleteBuyerList() throws Exception {

Manager adminManager = adminManagerLogin();
Token tokenAdmin = tokenRepository.findByManager(adminManager).get();

mockMvc.perform(
delete("/api/buyer/delete")
.header("TOKEN", tokenAdmin.getToken())
.content(readJson("/json/delete.json"))
.contentType(MediaType.APPLICATION_JSON)
)
.andExpect(status().isOk())
.andDo(restDocs.document(
requestHeaders(
headerWithName("TOKEN").description("해당 로그인 유저의 토큰값")
),
requestFields(
fieldWithPath("id").description("번호")
),
responseFields(
fieldWithPath("data").description("결과 데이터"),
fieldWithPath("data.result").description("문의 삭제 전송 성공 여부"),
fieldWithPath("data.message").description("response 메시지"),
fieldWithPath("status").description("HTTP Status")
)
)
);
}

}

0 comments on commit 250b8bc

Please sign in to comment.