-
Notifications
You must be signed in to change notification settings - Fork 2
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
test: Database cleaner 리팩토링 #389
Conversation
public void beforeEach(ExtensionContext extensionContext) { | ||
var applicationContext = SpringExtension.getApplicationContext(extensionContext); | ||
|
||
// validateTransactionalAnnotationExists(extensionContext); |
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.
여기는 사용 안하는 건가요?
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.
@uwoobeat 사용하려 했으나 MissionRepository 테스트 내에서는 @Transaction
이 걸려있지 않고, Repository 테스트 시 Assertions이 걸려서 지금 알아보고 있는 중임다
아마 @DataJpaTest
내에 Transactional 어노테이션이 걸려있어서 그런가 합리적 의심중...
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.
음 굳이 JUnit Extension으로 해결하지 않아도 괜찮지 않을까요?
요건 제가 딴 플젝에서 세팅한 통합 테스트 템플릿인데요, 여기서는 각각의 통합 테스트 클래스가 IntegrationTest
를 상속받도록 하고, 템플릿 내에서 @BeforeEach
에서 클리너를 명시적으로 호출하는 방식으로 해결했어요.
개인적으로는 auto detection 방식이 과도하게 로직을 감추고 있어서 내부 동작을 이해하기 어렵게 만드는 것 같다는 생각이 드네요
Quality Gate passedIssues Measures |
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.
lgtm
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.
LGTM
Quality Gate passedIssues Measures |
🌱 관련 이슈
📌 작업 내용 및 특이사항
📝 참고사항
📚 기타