Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spring REST Docs를 이용한 TC 기반의 API 문서 추출 #70

Open
choi-ys opened this issue Jan 18, 2022 · 0 comments
Open

Spring REST Docs를 이용한 TC 기반의 API 문서 추출 #70

choi-ys opened this issue Jan 18, 2022 · 0 comments

Comments

@choi-ys
Copy link
Owner

choi-ys commented Jan 18, 2022

plugins {
    id 'org.asciidoctor.jvm.convert' version '3.3.2'
}

configurations {
    asciidoctorExtensions
}

ext {
    snippetsDir = file('build/generated-snippets')
}

dependencies {
    testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc'
    asciidoctorExtensions 'org.springframework.restdocs:spring-restdocs-asciidoctor'
}

test {
    outputs.dir snippetsDir
}

/* [AsciiDoctor:Spring RETS Docs] Start */
asciidoctor {
    configurations 'asciidoctorExtensions'
    inputs.dir snippetsDir
    dependsOn test
}

task copyDocument(type: Copy) {
    dependsOn asciidoctor

    from "${asciidoctor.outputDir}"
    into file("src/main/resources/static/docs")
}

build {
    dependsOn copyDocument
}
/* [AsciiDoctor:Spring RETS Docs] End */
choi-ys added a commit that referenced this issue Jan 19, 2022
 - TC 결과를 이용한 asciidoc 기반 snippet 생성을 위한 의존성 추가 및 설정
 - user-service API 결과를 이용한 snippet 생성 부 작성
choi-ys added a commit that referenced this issue Jan 19, 2022
- TC 결과로 생성된 asciidoc 기반 snippet을 이용한 API Docs 작성
- 코드 리펙토링
  - snippet 생성 시, 잘못 명시된 문구 수정
  - 명확하지 않은 메소드 명 수정
choi-ys added a commit that referenced this issue Jan 19, 2022
[#70]Spring REST Docs를 이용한 TC 기반 API Docs 생성
choi-ys added a commit that referenced this issue Jan 20, 2022
 - 작성되지 않은 GlobalExceptionHandler 추가
 - 공통된 형태의 Error 반환을 위한 ErrorCode, ErrorDetail, ErrorResponse 작성
 - 존재하지 않는 자원 요청 시, 예외 처리를 위한 ResourceNotFoundException 작성
choi-ys added a commit that referenced this issue Jan 20, 2022
 - TC 기반의 snippet 생성을 위한 asciidoctor build 설정 추가
 - MockMvc를 이용한 TC의 요청/응답 URI 및 prettyPrint 설정 추가
 - snippet 생성 시 중복적으로 사용되는 부분 공통 함수화
 - API Docs 뼈대가 되는 index.adoc 작성
 - TC 수행 결과를 이용한 adoc 생성 부 작성 및 추가
 - 존재하지 않는 상품 조회 요청의 404응답 누락 TC 추가
 - 기타 상품 관련 TC 수행에 필요한 객체 생성 부 Package 구조 수정
   - AS-IS : generator
   - TO-BE : generator.mock
choi-ys added a commit that referenced this issue Jan 20, 2022
[#70][product-service]TC 기반 API Docs 생성
choi-ys added a commit that referenced this issue Jan 20, 2022
 - TC 기반의 snippet 생성을 위한 asciidoctor build 설정 추가
 - MockMvc를 이용한 TC의 요청/응답 URI 및 prettyPrint 설정 추가
 - snippet 생성 시 중복적으로 사용되는 부분 공통 함수화
 - API Docs 뼈대가 되는 index.adoc 작성
 - 기타 주문 관련 TC 수행에 필요한 객체 생성 부 Package 구조 수정
   - AS-IS : generator
   - TO-BE : generator.mock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant