-
Notifications
You must be signed in to change notification settings - Fork 5
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
[Feature] - BE 테스트 개선 스프링 컨텍스트 캐싱 최적화 #625
Open
Libienz
wants to merge
8
commits into
develop/be
Choose a base branch
from
feature/be/#624
base: develop/be
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
fa2db49
refactor: 모든 서비스 테스트 스프링 부트 테스트 기반으로 통일 개
Libienz e2a7b6f
refactor: IntegerationTest -> AbstractIntegrationTest 이름 변경
Libienz e448c21
refactor: 컨트롤러 테스트 구조 계층화
Libienz e3c4431
refactor: 테스트 공통 로직 메서드명 변경
Libienz c11d3a5
refactor: 컨트롤러 테스트가 공통 로직을 사용하도록 추상화된 클래스 상속
Libienz ebc6fbf
feat: 서비스 통합 테스트 추상 클래스 정의
Libienz f69c93a
feat: 서비스 통합 테스트들이 추상화된 공통로직을 사용하도록 상속
Libienz eef17d5
refactor: 사용하지 않는 애너테이션 제거 개선
Libienz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
backend/src/test/java/kr/touroot/global/AbstractControllerIntegrationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package kr.touroot.global; | ||
|
||
import com.fasterxml.jackson.databind.ObjectMapper; | ||
import io.restassured.RestAssured; | ||
import kr.touroot.authentication.infrastructure.JwtTokenProvider; | ||
import kr.touroot.utils.DatabaseCleaner; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; | ||
import org.springframework.boot.test.web.server.LocalServerPort; | ||
|
||
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT) | ||
public abstract class AbstractControllerIntegrationTest extends AbstractIntegrationTest { | ||
|
||
@Autowired | ||
protected DatabaseCleaner databaseCleaner; | ||
@Autowired | ||
protected ObjectMapper objectMapper; | ||
@Autowired | ||
protected JwtTokenProvider jwtTokenProvider; | ||
@LocalServerPort | ||
protected int port; | ||
|
||
@BeforeEach | ||
protected void baseSetUp() { | ||
RestAssured.port = port; | ||
databaseCleaner.executeTruncate(); | ||
} | ||
} |
6 changes: 5 additions & 1 deletion
6
...va/kr/touroot/global/IntegrationTest.java → ...uroot/global/AbstractIntegrationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
backend/src/test/java/kr/touroot/global/AbstractServiceIntegrationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
package kr.touroot.global; | ||
|
||
import kr.touroot.utils.DatabaseCleaner; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.springframework.beans.factory.annotation.Autowired; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment; | ||
|
||
@SpringBootTest(webEnvironment = WebEnvironment.NONE) | ||
public abstract class AbstractServiceIntegrationTest extends AbstractIntegrationTest { | ||
|
||
@Autowired | ||
protected DatabaseCleaner databaseCleaner; | ||
|
||
@BeforeEach | ||
protected void baseSetUp() { | ||
databaseCleaner.executeTruncate(); | ||
} | ||
} |
15 changes: 0 additions & 15 deletions
15
backend/src/test/java/kr/touroot/global/AcceptanceTest.java
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
매번 불필요하게 반복되던 공통 로직이 잘 모였군요 👍
네이밍은 전 지금도 좋은 것 같습니다. 조금 긴 감이 있긴한데 오히려 명확한게 좋다고 생각해요~