-
Notifications
You must be signed in to change notification settings - Fork 3
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
refactor: 테스트 코드 내 로그인 중복 제거 #453
Merged
Merged
Changes from 30 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
773a0c9
feat: id를 사용하는 entity는 BaseEntity를 상속하도록 수정 (#293)
thdwoqor 83c6004
refactor: 룸 업로드 페이지 리팩터링 (#307)
Songusika 3f6489b
refactor: 룸, 트랙, 미디어소스 역정규화 (#309)
0chil 24f03e3
feat: 카카오 소셜 로그인 기능을 구현한다. (#301)
kong-hana01 07c88f8
chore: 데이터 베이스 테이블 컬럼 수정 (#311)
thdwoqor a1b2d4f
feat: IdTokenResolver가 Provider에 맞게 동작한다 (#314)
0chil 9db7cc6
feat: 게스트로 로그인한다 (#316)
0chil 009f9fd
chore: 중복된 ci 파일 제거 (#323)
kong-hana01 c817a18
Merge branch 'backend' of https://github.com/woowacourse-teams/2023-d…
kong-hana01 9abac13
Merge branch 'backend' of https://github.com/woowacourse-teams/2023-d…
kong-hana01 dddb165
Merge branch 'backend' of https://github.com/woowacourse-teams/2023-d…
kong-hana01 9ab764f
fix: 피드백 검증을 하지 않는 문제 해결
kong-hana01 fc5acb1
chore: 컨벤션 통일
kong-hana01 9dea15a
refactor: DatabaseCleaner 인터페이스 및 구현체 구현
kong-hana01 8760bed
refactor: AuthDatabaseCleaner 구현
kong-hana01 3c3a33f
refactor: 외부에서 값을 주입받아 빈을 생성하도록 변경
kong-hana01 c5eb0da
chore: 패키지 구조 변경(util -> config)
kong-hana01 ce345b8
refactor: ControllerTest의 profile 설정
kong-hana01 ca9faac
feat: MockLogin 객체 구현
kong-hana01 6bfa6b3
feat: MockLogin 객체 구현
kong-hana01 cbe2ec2
refactor: default 환경을 구성하는 컨트롤러 테스트 격리
kong-hana01 f7ca27f
feat: 로그인을 담당하는 mock 서버 구현
kong-hana01 8271418
refactor: 로그인 환경을 설정하는 ControllerTestConfig 객체 구현
kong-hana01 b05d9c9
refactor: 멤버 정보를 재사용해서 테스트를 하도록 변경
kong-hana01 44ba455
fix: FeedbackControllerTest에서 캐싱사용하도록 변경
kong-hana01 c619ef4
docs: 예외 로그 확인 ci 파일 추가
kong-hana01 17fe93a
refactor: TestInstance 단위를 class로 변경
kong-hana01 2a8bb20
refactor: MockLoginServer의 빈 스코프를 프로토타입으로 변경
kong-hana01 403e93e
docs: ci 파일 복구
kong-hana01 5f2fe81
refactor: 테스트 내 환경을 @TestConfiguration으로 변경
kong-hana01 327601f
chore: 사용하지 않는 콘솔 출력 제거
kong-hana01 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
16 changes: 10 additions & 6 deletions
16
backend/src/main/java/com/digginroom/digginroom/feedback/controller/FeedbackController.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
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
34 changes: 34 additions & 0 deletions
34
backend/src/test/java/com/digginroom/digginroom/config/ControllerTestConfig.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,34 @@ | ||
package com.digginroom.digginroom.config; | ||
|
||
import static com.digginroom.digginroom.config.DatabaseTableName.MEMBER; | ||
import static com.digginroom.digginroom.config.DatabaseTableName.MEMBER_GENRE; | ||
import static com.digginroom.digginroom.config.DatabaseTableName.SPRING_SESSION; | ||
import static com.digginroom.digginroom.config.DatabaseTableName.SPRING_SESSION_ATTRIBUTES; | ||
|
||
import java.util.Set; | ||
import org.springframework.boot.test.context.TestConfiguration; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Profile; | ||
import org.springframework.web.reactive.function.client.WebClient; | ||
|
||
@TestConfiguration | ||
public class ControllerTestConfig { | ||
|
||
@Bean | ||
@Profile("default") | ||
public DatabaseCleaner getDatabaseCleanerBean() { | ||
return new DatabaseCleaner(Set.of()); | ||
} | ||
|
||
@Bean | ||
@Profile("auth") | ||
public DatabaseCleaner getAuthDatabaseCleanerBean() { | ||
return new DatabaseCleaner(Set.of(MEMBER, MEMBER_GENRE, SPRING_SESSION, SPRING_SESSION_ATTRIBUTES)); | ||
} | ||
|
||
Comment on lines
+25
to
+28
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. 인정합니다! |
||
@Bean | ||
@Profile("auth") | ||
public WebClient.Builder getWebClientBuilder() { | ||
return WebClient.builder(); | ||
} | ||
} |
17 changes: 12 additions & 5 deletions
17
...room/digginroom/util/DatabaseCleaner.java → ...om/digginroom/config/DatabaseCleaner.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
2 changes: 1 addition & 1 deletion
2
...inroom/util/DatabaseCleanerExtension.java → ...room/config/DatabaseCleanerExtension.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
29 changes: 29 additions & 0 deletions
29
backend/src/test/java/com/digginroom/digginroom/config/DatabaseTableName.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,29 @@ | ||
package com.digginroom.digginroom.config; | ||
|
||
import java.util.Arrays; | ||
|
||
public enum DatabaseTableName { | ||
|
||
MEMBER("member"), | ||
MEMBER_GENRE("member_genre"), | ||
SPRING_SESSION("spring_session"), | ||
SPRING_SESSION_ATTRIBUTES("spring_session_attributes"), | ||
EMPTY(""); | ||
|
||
private final String name; | ||
|
||
DatabaseTableName(final String name) { | ||
this.name = name; | ||
} | ||
|
||
public static DatabaseTableName of(final String name) { | ||
return Arrays.stream(values()) | ||
.filter(databaseTableName -> databaseTableName.getName().equalsIgnoreCase(name)) | ||
.findFirst() | ||
.orElse(EMPTY); | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
} |
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.
제가 싼 💩을 치워주셨군요..👍