-
Notifications
You must be signed in to change notification settings - Fork 1
[LNK-45] 링크 테스트 코드 작성 (Usecase) #80
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
The head ref may contain hidden characters: "LNK-45-Leenk-\uB9C1\uD06C-\uD14C\uC2A4\uD2B8-\uCF54\uB4DC-\uC791\uC131"
Changes from 34 commits
25374c6
461acbd
54933fb
8ba89bd
f4edce1
e54aa3f
a243241
fc5c53c
ebd4a1c
ec64a2e
e217a14
74e0cb7
738d76b
fdefb58
2a3ec53
b3560c0
93d73d9
fc47819
cf62bb2
990f4e4
4e606a4
ae7d5b6
adcb4c0
6686587
5589dbe
a750d78
18ac943
7e5511f
9a18f93
2271960
ef9b3a8
10d5349
b9ce301
f5db8cf
77b54de
15a9cff
ae4792c
56ed51c
aa4c05d
c9c818f
140c5b3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,10 @@ plugins { | |
| id 'java' | ||
| id 'org.springframework.boot' version '3.5.0' | ||
| id 'io.spring.dependency-management' version '1.1.7' | ||
|
|
||
| // Kotlin | ||
| id 'org.jetbrains.kotlin.jvm' version '1.9.25' | ||
| id 'org.jetbrains.kotlin.plugin.spring' version '1.9.25' | ||
| } | ||
|
|
||
| group = 'leets' | ||
|
|
@@ -41,6 +45,14 @@ dependencies { | |
| // Test | ||
| testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
| testRuntimeOnly 'org.junit.platform:junit-platform-launcher' | ||
| testImplementation "org.junit.jupiter:junit-jupiter:5.8.1" | ||
coderabbitai[bot] marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| testImplementation 'org.springframework.boot:spring-boot-testcontainers' | ||
| testImplementation 'org.testcontainers:junit-jupiter' | ||
| testImplementation 'org.testcontainers:mysql' | ||
| testImplementation 'org.testcontainers:mongodb' | ||
| testImplementation "io.mockk:mockk:1.13.10" | ||
|
||
| testImplementation 'org.jetbrains.kotlin:kotlin-test-junit5' | ||
| testImplementation 'org.jetbrains.kotlin:kotlin-stdlib' | ||
|
|
||
| // S3 | ||
| implementation("software.amazon.awssdk:s3:2.31.54") | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| package leets.leenk.global.common.entity; | ||
|
|
||
| import lombok.Getter; | ||
| import lombok.NoArgsConstructor; | ||
| import lombok.experimental.SuperBuilder; | ||
| import org.springframework.data.annotation.CreatedDate; | ||
| import org.springframework.data.annotation.LastModifiedDate; | ||
|
|
||
| import java.time.LocalDateTime; | ||
|
|
||
| @Getter | ||
| @SuperBuilder | ||
| @NoArgsConstructor | ||
| public abstract class MongoBaseEntity { | ||
|
Comment on lines
+11
to
+14
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. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for @EnableMongoAuditing in the codebase
echo "=== Searching for @EnableMongoAuditing ==="
rg -n '@EnableMongoAuditing' --type=java
echo ""
echo "=== Searching for MongoDB configuration classes ==="
# Look for common configuration class patterns
fd -e java -x grep -l "Configuration\|@Configuration" {} \; | head -20
echo ""
echo "=== Checking for MongoDbFactoryBean or MongoTemplate configuration ==="
rg -n 'MongoTemplate\|MongoRepository' --type=java -i | head -20Repository: Leets-Makers/Leenk-BE Length of output: 987
🤖 Prompt for AI Agents |
||
|
|
||
| @CreatedDate | ||
| private LocalDateTime createDate; | ||
|
|
||
| @LastModifiedDate | ||
| private LocalDateTime updateDate; | ||
| } | ||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| spring: | ||
| jpa: | ||
| hibernate: | ||
| ddl-auto: create-drop | ||
| show-sql: true | ||
| properties: | ||
| hibernate: | ||
| format_sql: true | ||
| dialect: org.hibernate.dialect.MySQL8Dialect |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| package leets.leenk.config; | ||
|
|
||
| import org.springframework.boot.test.context.TestConfiguration; | ||
| import org.springframework.boot.testcontainers.service.connection.ServiceConnection; | ||
| import org.springframework.context.annotation.Bean; | ||
| import org.testcontainers.containers.MySQLContainer; | ||
|
|
||
| @TestConfiguration | ||
| public class MysqlTestConfig { | ||
|
|
||
| private static final String MYSQL_IMAGE = "mysql:8.0.41"; | ||
|
|
||
| @Bean | ||
| @ServiceConnection | ||
| public MySQLContainer<?> mysqlContainer() { | ||
| return new MySQLContainer<>(MYSQL_IMAGE) | ||
| .withDatabaseName("testdb"); | ||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| package leets.leenk.config; | ||
|
|
||
| import org.junit.jupiter.api.Test; | ||
| import org.springframework.beans.factory.annotation.Autowired; | ||
| import org.springframework.boot.test.autoconfigure.jdbc.AutoConfigureTestDatabase; | ||
| import org.springframework.boot.test.autoconfigure.orm.jpa.DataJpaTest; | ||
| import org.springframework.context.annotation.Import; | ||
| import org.testcontainers.containers.MySQLContainer; | ||
|
|
||
| import static org.assertj.core.api.Assertions.assertThat; | ||
|
|
||
| @DataJpaTest | ||
| @Import(MysqlTestConfig.class) | ||
| @AutoConfigureTestDatabase(replace = AutoConfigureTestDatabase.Replace.NONE) | ||
| class TestContainersTest { | ||
|
|
||
| @Autowired | ||
| private MySQLContainer<?> mysqlContainer; | ||
|
|
||
|
|
||
| @Test | ||
| void MySQL_컨테이너_정상_동작_테스트() { | ||
| // MySQL 컨테이너 테스트 | ||
| assertThat(mysqlContainer).isNotNull(); | ||
| assertThat(mysqlContainer.isRunning()).isTrue(); | ||
| assertThat(mysqlContainer.getDatabaseName()).isEqualTo("testdb"); | ||
|
|
||
| System.out.println("MySQL Container JDBC URL: " + mysqlContainer.getJdbcUrl()); | ||
| } | ||
| } |
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.
현재 올린 #82 PR 머지되면 한번 PULL해서 최신화 해주세요!
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.
네넵 감사합니당!!