https://github.com/yeahdy/exam-test-pratice
계산기를 통해 성적을 계산하는 간단한 어플리케이션으로 Spring Test 를 위해 만든 프로젝트
https://github.com/yeahdy/exam-test-pratice
git-actions jacoco junit5 mockito spotless test-containers
Last synced: 11 months ago
JSON representation
계산기를 통해 성적을 계산하는 간단한 어플리케이션으로 Spring Test 를 위해 만든 프로젝트
- Host: GitHub
- URL: https://github.com/yeahdy/exam-test-pratice
- Owner: yeahdy
- Created: 2024-07-04T04:32:53.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-11T14:10:00.000Z (over 1 year ago)
- Last Synced: 2025-01-05T17:29:27.167Z (about 1 year ago)
- Topics: git-actions, jacoco, junit5, mockito, spotless, test-containers
- Language: Java
- Homepage:
- Size: 2.36 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## 📑Kind of Test
- **`JUnit`** 단위테스트
- **`Mock`** 단위테스트
- **`testcontainers` 통합테스트**
- MySQL
- Redis
- AWS S3
- Kafka
- **`archunit`**
- 패키지명-클래스명 코드컨벤션
- 계층 간 의존성 테스트
- **`jacoco` 테스트코드 커버리지**
- gradle 실행
```bash
$ gradle jacocoTestReport
```
- jacoco 테스트 커버리지 리포트
.\build\jacoco\jacoco.html\index.html
- **`spotless` 코드 포맷팅을 자동화**
```yaml
//build.gradle
spotless {
java {
googleJavaFormat()
removeUnusedImports()
trimTrailingWhitespace()
endWithNewline()
}
}
```
- **googleJavaFormat()**: Google의 Java 스타일 가이드에 따라 코드를 포맷팅
- **removeUnusedImports()**: 사용되지 않는 import 문을 자동 제거
- **trimTrailingWhitespace()**: 각 줄 끝에 있는 불필요한 공백 제거
- **endWithNewline()**: 파일 끝에 새 줄 추가
- gradle pre-commit 생성
commit 전 spotless 자동 실행 후 commit
```yaml
$ gradle addGitPrecommitHook
```
## ⚙️Infra
- Docker
- MySQL
- Flyway
관련 이슈: [Fiyway checksum 이슈](https://velog.io/@yeahdy/Flyway-Migration-checksum-mismatch-에러-해결)