lkd9125(이경도)
7 months ago
16 changed files with 66551 additions and 9 deletions
@ -0,0 +1,610 @@ |
|||||||
|
package kr.co.palnet.kac.flt.laanc; |
||||||
|
|
||||||
|
import kr.co.palnet.kac.BaseTest; |
||||||
|
import kr.co.palnet.kac.api.v1.flight.laanc.service.FlightLaancService; |
||||||
|
import org.junit.jupiter.api.DisplayName; |
||||||
|
import org.junit.jupiter.api.Test; |
||||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||||
|
import org.springframework.http.MediaType; |
||||||
|
import org.springframework.restdocs.headers.HeaderDocumentation; |
||||||
|
import org.springframework.restdocs.mockmvc.RestDocumentationRequestBuilders; |
||||||
|
import org.springframework.restdocs.payload.JsonFieldType; |
||||||
|
import org.springframework.transaction.annotation.Transactional; |
||||||
|
|
||||||
|
import java.util.UUID; |
||||||
|
|
||||||
|
import static org.springframework.restdocs.mockmvc.MockMvcRestDocumentation.document; |
||||||
|
import static org.springframework.restdocs.operation.preprocess.Preprocessors.preprocessResponse; |
||||||
|
import static org.springframework.restdocs.operation.preprocess.Preprocessors.prettyPrint; |
||||||
|
import static org.springframework.restdocs.request.RequestDocumentation.parameterWithName; |
||||||
|
import static org.springframework.restdocs.request.RequestDocumentation.pathParameters; |
||||||
|
import static org.springframework.restdocs.request.RequestDocumentation.queryParameters; |
||||||
|
import static org.springframework.restdocs.payload.PayloadDocumentation.*; |
||||||
|
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.*; |
||||||
|
import static org.springframework.test.web.servlet.result.MockMvcResultHandlers.print; |
||||||
|
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; |
||||||
|
|
||||||
|
public class FlightLaancControllerTest extends BaseTest { |
||||||
|
|
||||||
|
@Autowired |
||||||
|
private FlightLaancService flightLaancService; |
||||||
|
|
||||||
|
private final String BASE_URL = "/v1/flight/laanc"; |
||||||
|
|
||||||
|
private final String GRANT_TYPE = "Bearer"; |
||||||
|
|
||||||
|
@DisplayName("LAANC 승인 상세 조회") |
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void getLaancAprvDetail() throws Exception{ |
||||||
|
String planSno = "5"; |
||||||
|
|
||||||
|
String token = this.getUserToken(); |
||||||
|
|
||||||
|
String confirmKey = UUID.randomUUID().toString(); |
||||||
|
flightLaancService.testCreateQRCode(confirmKey, this.CREATE_USERNAME); |
||||||
|
|
||||||
|
this.mockMvc.perform( |
||||||
|
RestDocumentationRequestBuilders.get(this.BASE_URL + "/detail/{planSno}", planSno) |
||||||
|
.accept(MediaType.APPLICATION_JSON_VALUE) |
||||||
|
.header("Authorization", GRANT_TYPE + " " + token) |
||||||
|
) |
||||||
|
.andDo(print()) |
||||||
|
.andDo( |
||||||
|
document( |
||||||
|
"flight/laanc/detail", |
||||||
|
preprocessResponse(prettyPrint()), |
||||||
|
HeaderDocumentation.requestHeaders( |
||||||
|
HeaderDocumentation.headerWithName("Authorization").description("Access토큰 [로그인 발급]") |
||||||
|
), |
||||||
|
pathParameters( |
||||||
|
parameterWithName("planSno").description("비행계획서 일련번호") |
||||||
|
), |
||||||
|
responseFields( |
||||||
|
fieldWithPath("planSno").type(JsonFieldType.NUMBER).description("비행계획서 일련번호"), |
||||||
|
fieldWithPath("groupId").type(JsonFieldType.STRING).description("그룹 아이디"), |
||||||
|
fieldWithPath("cstmrSno").type(JsonFieldType.NUMBER).description("작성자 일련번호"), |
||||||
|
fieldWithPath("memberName").type(JsonFieldType.STRING).description("작성자 이름"), |
||||||
|
fieldWithPath("email").type(JsonFieldType.STRING).description("이메일"), |
||||||
|
fieldWithPath("hpno").type(JsonFieldType.STRING).description("연락처"), |
||||||
|
fieldWithPath("clncd").type(JsonFieldType.STRING).description("국가번호(연락처)"), |
||||||
|
fieldWithPath("addr").type(JsonFieldType.STRING).description("주소").optional(), |
||||||
|
fieldWithPath("addrDtlCn").type(JsonFieldType.STRING).description("상세주소").optional(), |
||||||
|
fieldWithPath("zip").type(JsonFieldType.STRING).description("우편번호").optional(), |
||||||
|
fieldWithPath("schFltStDt").type(JsonFieldType.STRING).description("비행시작일시"), |
||||||
|
fieldWithPath("schFltEndDt").type(JsonFieldType.STRING).description("비행종료일시"), |
||||||
|
fieldWithPath("fltPurpose").type(JsonFieldType.STRING).description("비행목적"), |
||||||
|
fieldWithPath("fltType").type(JsonFieldType.STRING).description("상업/비사업 구분"), |
||||||
|
fieldWithPath("fltTypeNm").type(JsonFieldType.STRING).description("상업/비사업 구분 코드"), |
||||||
|
fieldWithPath("aprvlYn").type(JsonFieldType.STRING).description("승인여부"), |
||||||
|
fieldWithPath("aprvlDt").type(JsonFieldType.STRING).description("승인일자"), |
||||||
|
fieldWithPath("fileGroupNo").type(JsonFieldType.NUMBER).description("파일그룹번호"), |
||||||
|
fieldWithPath("createUserId").type(JsonFieldType.STRING).description("등록자ID"), |
||||||
|
fieldWithPath("createDt").type(JsonFieldType.STRING).description("등록일시"), |
||||||
|
fieldWithPath("updateUserId").type(JsonFieldType.STRING).description("수정자ID"), |
||||||
|
fieldWithPath("updateDt").type(JsonFieldType.STRING).description("수정일시"), |
||||||
|
fieldWithPath("serviceType").type(JsonFieldType.STRING).description("각 항별 코드"), |
||||||
|
fieldWithPath("corpRegYn").type(JsonFieldType.STRING).description("기업여부"), |
||||||
|
fieldWithPath("pdfUrl").type(JsonFieldType.STRING).description("공문URL"), |
||||||
|
|
||||||
|
fieldWithPath("areaList").type(JsonFieldType.ARRAY).description("비행구역 리스트"), |
||||||
|
fieldWithPath("areaList[].planAreaSno").type(JsonFieldType.NUMBER).description("비행구역 일련번호"), |
||||||
|
fieldWithPath("areaList[].planSno").type(JsonFieldType.NUMBER).description("비행계획서 일련번호"), |
||||||
|
fieldWithPath("areaList[].areaType").type(JsonFieldType.STRING).description("비행구역 생성타입"), |
||||||
|
fieldWithPath("areaList[].fltMethod").type(JsonFieldType.STRING).description("비행방식"), |
||||||
|
fieldWithPath("areaList[].fltAreaAddr").type(JsonFieldType.STRING).description("비행구역주소"), |
||||||
|
fieldWithPath("areaList[].bufferZone").type(JsonFieldType.NUMBER).description("버퍼존"), |
||||||
|
fieldWithPath("areaList[].fltElev").type(JsonFieldType.STRING).description("고도"), |
||||||
|
fieldWithPath("areaList[].createUserId").type(JsonFieldType.STRING).description("생성자ID"), |
||||||
|
fieldWithPath("areaList[].createDt").type(JsonFieldType.STRING).description("생성일시"), |
||||||
|
fieldWithPath("areaList[].updateUserId").type(JsonFieldType.STRING).description("수정자ID"), |
||||||
|
fieldWithPath("areaList[].updateDt").type(JsonFieldType.STRING).description("수정일시"), |
||||||
|
fieldWithPath("areaList[].docState").type(JsonFieldType.STRING).description("코드"), |
||||||
|
fieldWithPath("areaList[].coordList").type(JsonFieldType.ARRAY).description("비행구역 좌표리스트").optional(), |
||||||
|
fieldWithPath("areaList[].bufferCoordList").type(JsonFieldType.ARRAY).description("비행 버퍼 좌표리스트").optional(), |
||||||
|
fieldWithPath("areaList[].fltMothoeRm").type(JsonFieldType.STRING).description("비행방식(기타)"), |
||||||
|
|
||||||
|
fieldWithPath("arcrftList").type(JsonFieldType.ARRAY).description("비행기체 리스트"), |
||||||
|
fieldWithPath("arcrftList[].planArcrftSno").type(JsonFieldType.NUMBER).description("계획서 기체 일련번호"), |
||||||
|
fieldWithPath("arcrftList[].planSno").type(JsonFieldType.NUMBER).description("비행계획서 일련번호"), |
||||||
|
fieldWithPath("arcrftList[].arcrftSno").type(JsonFieldType.NUMBER).description("기체 일련번호").optional(), |
||||||
|
fieldWithPath("arcrftList[].idntfNum").type(JsonFieldType.STRING).description("식별번호(기체번호)"), |
||||||
|
fieldWithPath("arcrftList[].groupNm").type(JsonFieldType.STRING).description("그룹명"), |
||||||
|
fieldWithPath("arcrftList[].prdctNum").type(JsonFieldType.STRING).description("제작번호"), |
||||||
|
fieldWithPath("arcrftList[].arcrftTypeCd").type(JsonFieldType.STRING).description("기체종류코드"), |
||||||
|
fieldWithPath("arcrftList[].arcrftModelNm").type(JsonFieldType.STRING).description("기체모델명"), |
||||||
|
fieldWithPath("arcrftList[].prdctCmpnNm").type(JsonFieldType.STRING).description("제작자"), |
||||||
|
fieldWithPath("arcrftList[].prdctDate").type(JsonFieldType.STRING).description("제작일자").optional(), |
||||||
|
fieldWithPath("arcrftList[].arcrftLngth").type(JsonFieldType.NUMBER).description("기체길이"), |
||||||
|
fieldWithPath("arcrftList[].arcrftWdth").type(JsonFieldType.NUMBER).description("길체폭"), |
||||||
|
fieldWithPath("arcrftList[].arcrftHght").type(JsonFieldType.NUMBER).description("기체높이"), |
||||||
|
fieldWithPath("arcrftList[].arcrftWght").type(JsonFieldType.NUMBER).description("기체중량"), |
||||||
|
fieldWithPath("arcrftList[].wghtTypeCd").type(JsonFieldType.STRING).description("중량구분코드"), |
||||||
|
fieldWithPath("arcrftList[].imageUrl").type(JsonFieldType.STRING).description("이미지URL"), |
||||||
|
fieldWithPath("arcrftList[].takeoffWght").type(JsonFieldType.NUMBER).description("최대이륙중량"), |
||||||
|
fieldWithPath("arcrftList[].useYn").type(JsonFieldType.STRING).description("사용여부"), |
||||||
|
fieldWithPath("arcrftList[].cameraYn").type(JsonFieldType.STRING).description("카메라탑재여부"), |
||||||
|
fieldWithPath("arcrftList[].insrncYn").type(JsonFieldType.STRING).description("보험가입여부"), |
||||||
|
fieldWithPath("arcrftList[].ownerNm").type(JsonFieldType.STRING).description("소유자명(법인명)"), |
||||||
|
fieldWithPath("arcrftList[].createUserId").type(JsonFieldType.STRING).description("생성자ID"), |
||||||
|
fieldWithPath("arcrftList[].createDt").type(JsonFieldType.STRING).description("생성일시"), |
||||||
|
fieldWithPath("arcrftList[].updateUserId").type(JsonFieldType.STRING).description("수정자ID"), |
||||||
|
fieldWithPath("arcrftList[].updateDt").type(JsonFieldType.STRING).description("수정일시"), |
||||||
|
fieldWithPath("arcrftList[].docState").type(JsonFieldType.STRING).description("코드"), |
||||||
|
fieldWithPath("arcrftList[].idntfTypeCd").type(JsonFieldType.STRING).description("식별장치종류코드").optional(), |
||||||
|
fieldWithPath("arcrftList[].acrftInsuranceYn").type(JsonFieldType.STRING).description("기체보험유무"), |
||||||
|
fieldWithPath("arcrftList[].insuranceExperiod").type(JsonFieldType.STRING).description("보험유효기간").optional(), |
||||||
|
fieldWithPath("arcrftList[].corporationNm").type(JsonFieldType.STRING).description("법인명").optional(), |
||||||
|
fieldWithPath("arcrftList[].arcrftWghtCd").type(JsonFieldType.STRING).description("자체중량코드"), |
||||||
|
|
||||||
|
fieldWithPath("pilotList").type(JsonFieldType.ARRAY).description("공문URL").optional(), |
||||||
|
fieldWithPath("arcrftWght").type(JsonFieldType.STRING).description("기체 중량설명"), |
||||||
|
fieldWithPath("elev").type(JsonFieldType.STRING).description("비행고도") |
||||||
|
) |
||||||
|
) |
||||||
|
) |
||||||
|
.andExpect(status().isOk()); |
||||||
|
} |
||||||
|
|
||||||
|
@DisplayName("LAANC 승인 목록") |
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void getLaancAprvList() throws Exception{ |
||||||
|
// TODO::TEST로 만들 비행계획서 필요함
|
||||||
|
|
||||||
|
String createStDate = "2024-02-23"; |
||||||
|
String createEndDate = "2024-02-23"; |
||||||
|
|
||||||
|
String token = this.getUserToken(); |
||||||
|
|
||||||
|
this.mockMvc.perform( |
||||||
|
get(this.BASE_URL + "/list") |
||||||
|
.param("createStDate",createStDate) |
||||||
|
.param("createEndDate",createEndDate) |
||||||
|
.accept(MediaType.APPLICATION_JSON_VALUE) |
||||||
|
.header("Authorization", GRANT_TYPE + " " + token) |
||||||
|
) |
||||||
|
.andDo(print()) |
||||||
|
.andDo( |
||||||
|
document( |
||||||
|
"flight/laanc/list", |
||||||
|
preprocessResponse(prettyPrint()), |
||||||
|
HeaderDocumentation.requestHeaders( |
||||||
|
HeaderDocumentation.headerWithName("Authorization").description("Access토큰 [로그인 발급]") |
||||||
|
), |
||||||
|
queryParameters( |
||||||
|
parameterWithName("createStDate").description("검색 시작일").optional(), |
||||||
|
parameterWithName("createEndDate").description("검색 끝일").optional(), |
||||||
|
parameterWithName("memberName").description("이름").optional() |
||||||
|
), |
||||||
|
responseFields( |
||||||
|
fieldWithPath("[].planSno").type(JsonFieldType.NUMBER).description("비행계획서 일련번호"), |
||||||
|
fieldWithPath("[].groupId").type(JsonFieldType.STRING).description("그룹 아이디"), |
||||||
|
fieldWithPath("[].cstmrSno").type(JsonFieldType.NUMBER).description("작성자 일련번호"), |
||||||
|
fieldWithPath("[].memberName").type(JsonFieldType.STRING).description("작성자 이름"), |
||||||
|
fieldWithPath("[].email").type(JsonFieldType.STRING).description("이메일"), |
||||||
|
fieldWithPath("[].hpno").type(JsonFieldType.STRING).description("연락처"), |
||||||
|
fieldWithPath("[].clncd").type(JsonFieldType.STRING).description("국가번호(연락처)"), |
||||||
|
fieldWithPath("[].addr").type(JsonFieldType.STRING).description("주소").optional(), |
||||||
|
fieldWithPath("[].addrDtlCn").type(JsonFieldType.STRING).description("상세주소").optional(), |
||||||
|
fieldWithPath("[].zip").type(JsonFieldType.STRING).description("우편번호").optional(), |
||||||
|
fieldWithPath("[].schFltStDt").type(JsonFieldType.STRING).description("비행시작일시"), |
||||||
|
fieldWithPath("[].schFltEndDt").type(JsonFieldType.STRING).description("비행종료일시"), |
||||||
|
fieldWithPath("[].fltPurpose").type(JsonFieldType.STRING).description("비행목적"), |
||||||
|
fieldWithPath("[].fltType").type(JsonFieldType.STRING).description("상업/비사업 구분"), |
||||||
|
fieldWithPath("[].fltTypeNm").type(JsonFieldType.STRING).description("상업/비사업 구분 코드"), |
||||||
|
fieldWithPath("[].aprvlYn").type(JsonFieldType.STRING).description("승인여부"), |
||||||
|
fieldWithPath("[].aprvlDt").type(JsonFieldType.STRING).description("승인일자"), |
||||||
|
fieldWithPath("[].fileGroupNo").type(JsonFieldType.NUMBER).description("파일그룹번호"), |
||||||
|
fieldWithPath("[].createUserId").type(JsonFieldType.STRING).description("등록자ID"), |
||||||
|
fieldWithPath("[].createDt").type(JsonFieldType.STRING).description("등록일시"), |
||||||
|
fieldWithPath("[].updateUserId").type(JsonFieldType.STRING).description("수정자ID"), |
||||||
|
fieldWithPath("[].updateDt").type(JsonFieldType.STRING).description("수정일시"), |
||||||
|
fieldWithPath("[].serviceType").type(JsonFieldType.STRING).description("각 항별 코드"), |
||||||
|
fieldWithPath("[].corpRegYn").type(JsonFieldType.STRING).description("기업여부"), |
||||||
|
fieldWithPath("[].pdfUrl").type(JsonFieldType.STRING).description("공문URL"), |
||||||
|
|
||||||
|
fieldWithPath("[].areaList").type(JsonFieldType.ARRAY).description("비행구역 리스트"), |
||||||
|
fieldWithPath("[].areaList[].planAreaSno").type(JsonFieldType.NUMBER).description("비행구역 일련번호"), |
||||||
|
fieldWithPath("[].areaList[].planSno").type(JsonFieldType.NUMBER).description("비행계획서 일련번호"), |
||||||
|
fieldWithPath("[].areaList[].areaType").type(JsonFieldType.STRING).description("비행구역 생성타입"), |
||||||
|
fieldWithPath("[].areaList[].fltMethod").type(JsonFieldType.STRING).description("비행방식"), |
||||||
|
fieldWithPath("[].areaList[].fltAreaAddr").type(JsonFieldType.STRING).description("비행구역주소"), |
||||||
|
fieldWithPath("[].areaList[].bufferZone").type(JsonFieldType.NUMBER).description("버퍼존"), |
||||||
|
fieldWithPath("[].areaList[].fltElev").type(JsonFieldType.STRING).description("고도"), |
||||||
|
fieldWithPath("[].areaList[].createUserId").type(JsonFieldType.STRING).description("생성자ID"), |
||||||
|
fieldWithPath("[].areaList[].createDt").type(JsonFieldType.STRING).description("생성일시"), |
||||||
|
fieldWithPath("[].areaList[].updateUserId").type(JsonFieldType.STRING).description("수정자ID"), |
||||||
|
fieldWithPath("[].areaList[].updateDt").type(JsonFieldType.STRING).description("수정일시"), |
||||||
|
fieldWithPath("[].areaList[].docState").type(JsonFieldType.STRING).description("코드"), |
||||||
|
fieldWithPath("[].areaList[].coordList").type(JsonFieldType.ARRAY).description("비행구역 좌표리스트").optional(), |
||||||
|
fieldWithPath("[].areaList[].bufferCoordList").type(JsonFieldType.ARRAY).description("비행 버퍼 좌표리스트").optional(), |
||||||
|
fieldWithPath("[].areaList[].fltMothoeRm").type(JsonFieldType.STRING).description("비행방식(기타)"), |
||||||
|
|
||||||
|
fieldWithPath("[].arcrftList").type(JsonFieldType.ARRAY).description("비행기체 리스트"), |
||||||
|
fieldWithPath("[].arcrftList[].planArcrftSno").type(JsonFieldType.NUMBER).description("계획서 기체 일련번호"), |
||||||
|
fieldWithPath("[].arcrftList[].planSno").type(JsonFieldType.NUMBER).description("비행계획서 일련번호"), |
||||||
|
fieldWithPath("[].arcrftList[].arcrftSno").type(JsonFieldType.NUMBER).description("기체 일련번호").optional(), |
||||||
|
fieldWithPath("[].arcrftList[].idntfNum").type(JsonFieldType.STRING).description("식별번호(기체번호)"), |
||||||
|
fieldWithPath("[].arcrftList[].groupNm").type(JsonFieldType.STRING).description("그룹명"), |
||||||
|
fieldWithPath("[].arcrftList[].prdctNum").type(JsonFieldType.STRING).description("제작번호"), |
||||||
|
fieldWithPath("[].arcrftList[].arcrftTypeCd").type(JsonFieldType.STRING).description("기체종류코드"), |
||||||
|
fieldWithPath("[].arcrftList[].arcrftModelNm").type(JsonFieldType.STRING).description("기체모델명"), |
||||||
|
fieldWithPath("[].arcrftList[].prdctCmpnNm").type(JsonFieldType.STRING).description("제작자"), |
||||||
|
fieldWithPath("[].arcrftList[].prdctDate").type(JsonFieldType.STRING).description("제작일자").optional(), |
||||||
|
fieldWithPath("[].arcrftList[].arcrftLngth").type(JsonFieldType.NUMBER).description("기체길이"), |
||||||
|
fieldWithPath("[].arcrftList[].arcrftWdth").type(JsonFieldType.NUMBER).description("길체폭"), |
||||||
|
fieldWithPath("[].arcrftList[].arcrftHght").type(JsonFieldType.NUMBER).description("기체높이"), |
||||||
|
fieldWithPath("[].arcrftList[].arcrftWght").type(JsonFieldType.NUMBER).description("기체중량"), |
||||||
|
fieldWithPath("[].arcrftList[].wghtTypeCd").type(JsonFieldType.STRING).description("중량구분코드"), |
||||||
|
fieldWithPath("[].arcrftList[].imageUrl").type(JsonFieldType.STRING).description("이미지URL"), |
||||||
|
fieldWithPath("[].arcrftList[].takeoffWght").type(JsonFieldType.NUMBER).description("최대이륙중량"), |
||||||
|
fieldWithPath("[].arcrftList[].useYn").type(JsonFieldType.STRING).description("사용여부"), |
||||||
|
fieldWithPath("[].arcrftList[].cameraYn").type(JsonFieldType.STRING).description("카메라탑재여부"), |
||||||
|
fieldWithPath("[].arcrftList[].insrncYn").type(JsonFieldType.STRING).description("보험가입여부"), |
||||||
|
fieldWithPath("[].arcrftList[].ownerNm").type(JsonFieldType.STRING).description("소유자명(법인명)"), |
||||||
|
fieldWithPath("[].arcrftList[].createUserId").type(JsonFieldType.STRING).description("생성자ID"), |
||||||
|
fieldWithPath("[].arcrftList[].createDt").type(JsonFieldType.STRING).description("생성일시"), |
||||||
|
fieldWithPath("[].arcrftList[].updateUserId").type(JsonFieldType.STRING).description("수정자ID"), |
||||||
|
fieldWithPath("[].arcrftList[].updateDt").type(JsonFieldType.STRING).description("수정일시"), |
||||||
|
fieldWithPath("[].arcrftList[].docState").type(JsonFieldType.STRING).description("코드"), |
||||||
|
fieldWithPath("[].arcrftList[].idntfTypeCd").type(JsonFieldType.STRING).description("식별장치종류코드").optional(), |
||||||
|
fieldWithPath("[].arcrftList[].acrftInsuranceYn").type(JsonFieldType.STRING).description("기체보험유무"), |
||||||
|
fieldWithPath("[].arcrftList[].insuranceExperiod").type(JsonFieldType.STRING).description("보험유효기간").optional(), |
||||||
|
fieldWithPath("[].arcrftList[].corporationNm").type(JsonFieldType.STRING).description("법인명").optional(), |
||||||
|
fieldWithPath("[].arcrftList[].arcrftWghtCd").type(JsonFieldType.STRING).description("자체중량코드"), |
||||||
|
|
||||||
|
fieldWithPath("[].pilotList").type(JsonFieldType.ARRAY).description("공문URL").optional(), |
||||||
|
fieldWithPath("[].arcrftWght").type(JsonFieldType.STRING).description("기체 중량설명"), |
||||||
|
fieldWithPath("[].elev").type(JsonFieldType.STRING).description("비행고도") |
||||||
|
) |
||||||
|
) |
||||||
|
) |
||||||
|
.andExpect(status().isOk()); |
||||||
|
} |
||||||
|
|
||||||
|
@DisplayName("공역(금지구역) 체크") |
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void getAllowableElevation() throws Exception{ |
||||||
|
String jsonRQ = """ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"areaType" : "LINE", |
||||||
|
"bufferZone" : 100, |
||||||
|
"coordList" : [ |
||||||
|
{ |
||||||
|
"lat" : 127.277715, |
||||||
|
"lon" : 37.406649 |
||||||
|
}, |
||||||
|
{ |
||||||
|
"lat" : 127.158070, |
||||||
|
"lon" : 37.409050 |
||||||
|
} |
||||||
|
] |
||||||
|
} |
||||||
|
] |
||||||
|
"""; |
||||||
|
|
||||||
|
String token = this.getUserToken(); |
||||||
|
|
||||||
|
this.mockMvc.perform( |
||||||
|
post(this.BASE_URL + "/valid/elev") |
||||||
|
.contentType(MediaType.APPLICATION_JSON_VALUE) |
||||||
|
.content(jsonRQ) |
||||||
|
.accept(MediaType.APPLICATION_JSON_VALUE) |
||||||
|
.header("Authorization", GRANT_TYPE + " " + token) |
||||||
|
) |
||||||
|
.andDo(print()) |
||||||
|
.andDo( |
||||||
|
document( |
||||||
|
"flight/laanc/valid/elev", |
||||||
|
preprocessResponse(prettyPrint()), |
||||||
|
HeaderDocumentation.requestHeaders( |
||||||
|
HeaderDocumentation.headerWithName("Authorization").description("Access토큰 [로그인 발급]") |
||||||
|
), |
||||||
|
requestFields( |
||||||
|
fieldWithPath("[].areaType").type(JsonFieldType.STRING).description("비행구역 생성타입"), |
||||||
|
fieldWithPath("[].bufferZone").type(JsonFieldType.NUMBER).description("버퍼존 크기"), |
||||||
|
|
||||||
|
fieldWithPath("[].coordList").type(JsonFieldType.ARRAY).description("비행구역 좌표리스트"), |
||||||
|
fieldWithPath("[].coordList[].lat").type(JsonFieldType.NUMBER).description("경도 [ex -> 126.706806]"), |
||||||
|
fieldWithPath("[].coordList[].lon").type(JsonFieldType.NUMBER).description("위도 [ex -> 37.50854]") |
||||||
|
), |
||||||
|
responseFields( |
||||||
|
fieldWithPath("allowableElevation").description("비행고도 허용값") |
||||||
|
) |
||||||
|
) |
||||||
|
) |
||||||
|
.andExpect(status().isOk()); |
||||||
|
} |
||||||
|
|
||||||
|
@DisplayName("공역(금지구역) 체크") |
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void getDuplicatedAirspace() throws Exception{ |
||||||
|
String jsonRQ = """ |
||||||
|
[ |
||||||
|
{ |
||||||
|
"areaType" : "LINE", |
||||||
|
"bufferZone" : 100, |
||||||
|
"fltElev" : 130, |
||||||
|
"coordList" : [ |
||||||
|
{ |
||||||
|
"lat" : 126.706806, |
||||||
|
"lon" : 37.50854 |
||||||
|
}, |
||||||
|
{ |
||||||
|
"lat" : 126.7108901, |
||||||
|
"lon" : 37.5094849 |
||||||
|
}, |
||||||
|
{ |
||||||
|
"lat" : 126.7091884, |
||||||
|
"lon" : 37.5068526 |
||||||
|
} |
||||||
|
] |
||||||
|
} |
||||||
|
] |
||||||
|
"""; |
||||||
|
|
||||||
|
String token = this.getUserToken(); |
||||||
|
|
||||||
|
this.mockMvc.perform( |
||||||
|
post(this.BASE_URL + "/valid/duplicated/airspace") |
||||||
|
.contentType(MediaType.APPLICATION_JSON_VALUE) |
||||||
|
.content(jsonRQ) |
||||||
|
.accept(MediaType.APPLICATION_JSON_VALUE) |
||||||
|
.header("Authorization", GRANT_TYPE + " " + token) |
||||||
|
) |
||||||
|
.andDo(print()) |
||||||
|
.andDo( |
||||||
|
document( |
||||||
|
"flight/laanc/valid/duplicated/airspace", |
||||||
|
preprocessResponse(prettyPrint()), |
||||||
|
HeaderDocumentation.requestHeaders( |
||||||
|
HeaderDocumentation.headerWithName("Authorization").description("Access토큰 [로그인 발급]") |
||||||
|
), |
||||||
|
requestFields( |
||||||
|
fieldWithPath("[].areaType").type(JsonFieldType.STRING).description("비행구역 생성타입"), |
||||||
|
fieldWithPath("[].bufferZone").type(JsonFieldType.NUMBER).description("버퍼존 크기"), |
||||||
|
fieldWithPath("[].fltElev").type(JsonFieldType.NUMBER).description("비행 고도"), |
||||||
|
|
||||||
|
fieldWithPath("[].coordList").type(JsonFieldType.ARRAY).description("비행구역 좌표리스트"), |
||||||
|
fieldWithPath("[].coordList[].lat").type(JsonFieldType.NUMBER).description("경도 [ex -> 126.706806]"), |
||||||
|
fieldWithPath("[].coordList[].lon").type(JsonFieldType.NUMBER).description("위도 [ex -> 37.50854]") |
||||||
|
), |
||||||
|
responseFields( |
||||||
|
fieldWithPath("[].rq.areaType").type(JsonFieldType.STRING).description("비행구역 생성타입"), |
||||||
|
fieldWithPath("[].rq.bufferZone").type(JsonFieldType.NUMBER).description("버퍼존 크기"), |
||||||
|
fieldWithPath("[].rq.fltElev").type(JsonFieldType.STRING).description("비행 고도"), |
||||||
|
|
||||||
|
fieldWithPath("[].rq.coordList").type(JsonFieldType.ARRAY).description("비행구역 좌표리스트"), |
||||||
|
fieldWithPath("[].rq.coordList[].lat").type(JsonFieldType.NUMBER).description("경도 [ex -> 126.706806]"), |
||||||
|
fieldWithPath("[].rq.coordList[].lon").type(JsonFieldType.NUMBER).description("위도 [ex -> 37.50854]"), |
||||||
|
|
||||||
|
fieldWithPath("[].duplicated").type(JsonFieldType.BOOLEAN).description("공역 체크값") |
||||||
|
) |
||||||
|
) |
||||||
|
) |
||||||
|
.andExpect(status().isOk()); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
@DisplayName("TS QR 코드 확인") |
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void checkQrcode() throws Exception{ |
||||||
|
|
||||||
|
String token = this.getUserToken(); |
||||||
|
|
||||||
|
String confirmKey = UUID.randomUUID().toString(); |
||||||
|
flightLaancService.testCreateQRCode(confirmKey, this.CREATE_USERNAME); |
||||||
|
|
||||||
|
this.mockMvc.perform( |
||||||
|
RestDocumentationRequestBuilders.get(this.BASE_URL + "/ts/qr/{confirmKey}", confirmKey) |
||||||
|
.accept(MediaType.APPLICATION_JSON_VALUE) |
||||||
|
.header("Authorization", GRANT_TYPE + " " + token) |
||||||
|
) |
||||||
|
.andDo(print()) |
||||||
|
.andDo( |
||||||
|
document( |
||||||
|
"flight/laanc/ts/qr/confirm", |
||||||
|
preprocessResponse(prettyPrint()), |
||||||
|
HeaderDocumentation.requestHeaders( |
||||||
|
HeaderDocumentation.headerWithName("Authorization").description("Access토큰 [로그인 발급]") |
||||||
|
), |
||||||
|
pathParameters( |
||||||
|
parameterWithName("confirmKey").description("컨펌키") |
||||||
|
), |
||||||
|
responseFields( |
||||||
|
fieldWithPath("rspCode").type(JsonFieldType.STRING).description("결과코드"), |
||||||
|
fieldWithPath("rspMessage").type(JsonFieldType.STRING).description("결과메시지"), |
||||||
|
fieldWithPath("pilotcredentialyn").type(JsonFieldType.STRING).description("조종사자격증명여부"), |
||||||
|
fieldWithPath("arcrftinsuranceyn").type(JsonFieldType.STRING).description("기체보험가입여부"), |
||||||
|
fieldWithPath("arcrftdeclaration").type(JsonFieldType.STRING).description("기체신고여부"), |
||||||
|
fieldWithPath("corpregyn").type(JsonFieldType.STRING).description("사업자유무"), |
||||||
|
fieldWithPath("rq").type(JsonFieldType.OBJECT).description("QR코드 데이터").optional() |
||||||
|
) |
||||||
|
) |
||||||
|
) |
||||||
|
.andExpect(status().isOk()); |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
@DisplayName("TS QR 코드 생성") |
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void createQRcode() throws Exception{ |
||||||
|
String jsonRQ = """ |
||||||
|
{ |
||||||
|
"idntfNum" : "C1CM0231251" |
||||||
|
} |
||||||
|
"""; |
||||||
|
|
||||||
|
String token = this.getUserToken(); |
||||||
|
|
||||||
|
this.mockMvc.perform( |
||||||
|
post(this.BASE_URL + "/ts/qr") |
||||||
|
.contentType(MediaType.APPLICATION_JSON_VALUE) |
||||||
|
.content(jsonRQ) |
||||||
|
.accept(MediaType.APPLICATION_JSON_VALUE) |
||||||
|
.header("Authorization", GRANT_TYPE + " " + token) |
||||||
|
) |
||||||
|
.andDo(print()) |
||||||
|
.andDo( |
||||||
|
document( |
||||||
|
"flight/laanc/ts/qr", |
||||||
|
preprocessResponse(prettyPrint()), |
||||||
|
HeaderDocumentation.requestHeaders( |
||||||
|
HeaderDocumentation.headerWithName("Authorization").description("Access토큰 [로그인 발급]") |
||||||
|
), |
||||||
|
requestFields( |
||||||
|
fieldWithPath("idntfNum").type(JsonFieldType.STRING).description("기체 식별번호") |
||||||
|
), |
||||||
|
responseFields( |
||||||
|
fieldWithPath("qrcode").type(JsonFieldType.STRING).description("QR코드 데이터"), |
||||||
|
fieldWithPath("confirmKey").type(JsonFieldType.STRING).description("컨펌 키") |
||||||
|
) |
||||||
|
) |
||||||
|
) |
||||||
|
.andExpect(status().isCreated()); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
@DisplayName("비행계획서 생성") |
||||||
|
@Test |
||||||
|
@Transactional |
||||||
|
public void createPlan() throws Exception{ |
||||||
|
|
||||||
|
String jsonRQ = """ |
||||||
|
{ |
||||||
|
"cstmrSno": 3, |
||||||
|
"fltType": "COMMERCIAL", |
||||||
|
"schFltStDt": "2024-02-25T11:43:00", |
||||||
|
"schFltEndDt": "2024-02-28T15:46:00", |
||||||
|
"fltPurpose": "06", |
||||||
|
"serviceType": "KAC", |
||||||
|
"areaList" : [ |
||||||
|
{ |
||||||
|
"areaType": "LINE", |
||||||
|
"fltMethod": "02", |
||||||
|
"fltMothoeRm": "", |
||||||
|
"bufferZone": "100", |
||||||
|
"fltElev": "100", |
||||||
|
"coordList": [ |
||||||
|
{ |
||||||
|
"lat": 37.51625845252909, |
||||||
|
"lon": 126.72340194011286 |
||||||
|
}, |
||||||
|
{ |
||||||
|
"lat": 37.512215014051776, |
||||||
|
"lon": 126.72058946300956 |
||||||
|
}, |
||||||
|
{ |
||||||
|
"lat": 37.51123897883966, |
||||||
|
"lon": 126.72463239884405 |
||||||
|
} |
||||||
|
] |
||||||
|
} |
||||||
|
], |
||||||
|
"arcrftList" : [ |
||||||
|
{ |
||||||
|
"idntfNum": "PA0001", |
||||||
|
"groupNm": "", |
||||||
|
"prdctNum": "", |
||||||
|
"arcrftTypeCd": "11", |
||||||
|
"arcrftModelNm": "", |
||||||
|
"prdctCmpnNm": "", |
||||||
|
"prdctDate": "", |
||||||
|
"arcrftLngth": 0, |
||||||
|
"arcrftWghtCd": "8", |
||||||
|
"arcrftHght": 0, |
||||||
|
"arcrftWght": 0, |
||||||
|
"wghtTypeCd": "", |
||||||
|
"imageUrl": "", |
||||||
|
"takeoffWght": 0, |
||||||
|
"useYn": "", |
||||||
|
"cameraYn": "", |
||||||
|
"insrncYn": "", |
||||||
|
"ownerNm": "" |
||||||
|
} |
||||||
|
], |
||||||
|
"terms": [ |
||||||
|
|
||||||
|
] |
||||||
|
} |
||||||
|
"""; |
||||||
|
|
||||||
|
String token = this.getUserToken(); |
||||||
|
|
||||||
|
this.mockMvc.perform( |
||||||
|
post(this.BASE_URL + "/create/plan") |
||||||
|
.contentType(MediaType.APPLICATION_JSON_VALUE) |
||||||
|
.content(jsonRQ) |
||||||
|
.accept(MediaType.APPLICATION_JSON_VALUE) |
||||||
|
.header("Authorization", GRANT_TYPE + " " + token) |
||||||
|
) |
||||||
|
.andDo(print()) |
||||||
|
.andDo( |
||||||
|
document( |
||||||
|
"flight/laanc/create/plan", |
||||||
|
preprocessResponse(prettyPrint()), |
||||||
|
HeaderDocumentation.requestHeaders( |
||||||
|
HeaderDocumentation.headerWithName("Authorization").description("Access토큰 [로그인 발급]") |
||||||
|
), |
||||||
|
requestFields( |
||||||
|
fieldWithPath("cstmrSno").type(JsonFieldType.NUMBER).description("회원 고유번호").optional(), |
||||||
|
fieldWithPath("fltType").type(JsonFieldType.STRING).description("비행유형 - 상업/비상업"), |
||||||
|
fieldWithPath("schFltStDt").type(JsonFieldType.STRING).description("비행시작일시"), |
||||||
|
fieldWithPath("schFltEndDt").type(JsonFieldType.STRING).description("비행종료일시"), |
||||||
|
fieldWithPath("fltPurpose").type(JsonFieldType.STRING).description("비행목적"), |
||||||
|
fieldWithPath("serviceType").type(JsonFieldType.STRING).description("각 청들 코드"), |
||||||
|
|
||||||
|
fieldWithPath("areaList").type(JsonFieldType.ARRAY).description("비행구역 리스트"), |
||||||
|
fieldWithPath("areaList[].areaType").type(JsonFieldType.STRING).description("비행구역 생성타입"), |
||||||
|
fieldWithPath("areaList[].fltMethod").type(JsonFieldType.STRING).description("비행방식"), |
||||||
|
fieldWithPath("areaList[].fltMothoeRm").type(JsonFieldType.STRING).description("비행방식(기타)").optional(), |
||||||
|
fieldWithPath("areaList[].bufferZone").type(JsonFieldType.STRING).description("버퍼존"), |
||||||
|
fieldWithPath("areaList[].fltElev").type(JsonFieldType.STRING).description("비행고도"), |
||||||
|
fieldWithPath("areaList[].coordList").type(JsonFieldType.ARRAY).description("비행 좌표 리스트"), |
||||||
|
fieldWithPath("areaList[].coordList[].lat").type(JsonFieldType.NUMBER).description("위도"), |
||||||
|
fieldWithPath("areaList[].coordList[].lon").type(JsonFieldType.NUMBER).description("경도"), |
||||||
|
|
||||||
|
fieldWithPath("arcrftList").type(JsonFieldType.ARRAY).description("비행기체 정보리스트"), |
||||||
|
fieldWithPath("arcrftList[].idntfNum").type(JsonFieldType.STRING).description("식별번호(기체번호)"), |
||||||
|
fieldWithPath("arcrftList[].groupNm").type(JsonFieldType.STRING).description("그룹명").optional(), |
||||||
|
fieldWithPath("arcrftList[].prdctNum").type(JsonFieldType.STRING).description("제작번호").optional(), |
||||||
|
fieldWithPath("arcrftList[].arcrftTypeCd").type(JsonFieldType.STRING).description("기체종류코드"), |
||||||
|
fieldWithPath("arcrftList[].arcrftModelNm").type(JsonFieldType.STRING).description("기체모델명").optional(), |
||||||
|
fieldWithPath("arcrftList[].prdctCmpnNm").type(JsonFieldType.STRING).description("제작자").optional(), |
||||||
|
fieldWithPath("arcrftList[].prdctDate").type(JsonFieldType.STRING).description("제작일자").optional(), |
||||||
|
fieldWithPath("arcrftList[].arcrftLngth").type(JsonFieldType.NUMBER).description("기체길이").optional(), |
||||||
|
fieldWithPath("arcrftList[].arcrftWghtCd").type(JsonFieldType.STRING).description("자체중량코드"), |
||||||
|
fieldWithPath("arcrftList[].arcrftHght").type(JsonFieldType.NUMBER).description("기체높이").optional(), |
||||||
|
fieldWithPath("arcrftList[].arcrftWght").type(JsonFieldType.NUMBER).description("기체중량").optional(), |
||||||
|
fieldWithPath("arcrftList[].wghtTypeCd").type(JsonFieldType.STRING).description("중량구분코드").optional(), |
||||||
|
fieldWithPath("arcrftList[].imageUrl").type(JsonFieldType.STRING).description("이미지URL").optional(), |
||||||
|
fieldWithPath("arcrftList[].takeoffWght").type(JsonFieldType.NUMBER).description("최대이륙중량").optional(), |
||||||
|
fieldWithPath("arcrftList[].useYn").type(JsonFieldType.STRING).description("사용여부").optional(), |
||||||
|
fieldWithPath("arcrftList[].cameraYn").type(JsonFieldType.STRING).description("카메라탑재여부").optional(), |
||||||
|
fieldWithPath("arcrftList[].insrncYn").type(JsonFieldType.STRING).description("보험가입여부").optional(), |
||||||
|
fieldWithPath("arcrftList[].ownerNm").type(JsonFieldType.STRING).description("소유자명(법인명)").optional(), |
||||||
|
|
||||||
|
fieldWithPath("terms").type(JsonFieldType.ARRAY).description("약관동의리스트").optional(), |
||||||
|
fieldWithPath("terms[].termsSno").type(JsonFieldType.NUMBER).description("약관 일련번호").optional(), |
||||||
|
fieldWithPath("terms[].agressYn").type(JsonFieldType.STRING).description("동의 여부").optional() |
||||||
|
|
||||||
|
|
||||||
|
), |
||||||
|
responseFields( |
||||||
|
fieldWithPath("pdfUrl").type(JsonFieldType.STRING).description("PDF 다운로드 URL").optional(), |
||||||
|
fieldWithPath("address").type(JsonFieldType.STRING).description("주소").optional() |
||||||
|
) |
||||||
|
) |
||||||
|
) |
||||||
|
.andExpect(status().isCreated()); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
} |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,5 @@ |
|||||||
|
{ |
||||||
|
"type": "FeatureCollection", |
||||||
|
"features": [ |
||||||
|
] |
||||||
|
} |
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,5 @@ |
|||||||
|
{ |
||||||
|
"type": "FeatureCollection", |
||||||
|
"features": [ |
||||||
|
] |
||||||
|
} |
Loading…
Reference in new issue