-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2e8664e
commit 605cff5
Showing
5 changed files
with
28 additions
and
31 deletions.
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
15 changes: 2 additions & 13 deletions
15
...m/src/test/java/com/learning/ai/llmragwithspringai/TestLlmRagWithSpringAiApplication.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 |
---|---|---|
@@ -1,24 +1,13 @@ | ||
package com.learning.ai.llmragwithspringai; | ||
|
||
import com.learning.ai.llmragwithspringai.config.ContainersConfig; | ||
import org.springframework.boot.SpringApplication; | ||
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.PostgreSQLContainer; | ||
import org.testcontainers.utility.DockerImageName; | ||
|
||
@TestConfiguration(proxyBeanMethods = false) | ||
public class TestLlmRagWithSpringAiApplication { | ||
|
||
@Bean | ||
@ServiceConnection | ||
PostgreSQLContainer<?> pgvectorContainer() { | ||
return new PostgreSQLContainer<>(DockerImageName.parse("pgvector/pgvector:pg17")); | ||
} | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.from(LlmRagWithSpringAiApplication::main) | ||
.with(TestLlmRagWithSpringAiApplication.class) | ||
.with(ContainersConfig.class) | ||
.run(args); | ||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
...-openai-llm/src/test/java/com/learning/ai/llmragwithspringai/config/ContainersConfig.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,17 @@ | ||
package com.learning.ai.llmragwithspringai.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.PostgreSQLContainer; | ||
import org.testcontainers.utility.DockerImageName; | ||
|
||
@TestConfiguration(proxyBeanMethods = false) | ||
public class ContainersConfig { | ||
|
||
@Bean | ||
@ServiceConnection | ||
PostgreSQLContainer<?> pgvectorContainer() { | ||
return new PostgreSQLContainer<>(DockerImageName.parse("pgvector/pgvector:pg17")); | ||
} | ||
} |