Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
b5c8da0
Add Docker Compose sample for Doma Spring Boot (#291)
devin-ai-integration[bot] May 19, 2025
492079e
Fix code formatting issues
devin-ai-integration[bot] May 19, 2025
9a54fdc
Update Docker Compose sample to use Spring Boot's built-in Docker Com…
devin-ai-integration[bot] May 19, 2025
f8fca44
Fix code formatting issues
devin-ai-integration[bot] May 19, 2025
22218e7
Address PR feedback: Use Spring Boot Docker Compose support correctly
devin-ai-integration[bot] May 19, 2025
0c1d0e9
Address PR feedback: Remove duplicate properties and auto-detect dialect
devin-ai-integration[bot] May 19, 2025
54abc1d
Address PR feedback: Remove H2 dependency and update README
devin-ai-integration[bot] May 19, 2025
8d4b1e1
Remove openrewrite maven plugin from pom.xml
making May 19, 2025
b833b87
Add TestContainers sample for Doma Spring Boot (#310)
devin-ai-integration[bot] May 19, 2025
c2b2c05
Update Docker Compose sample to match TestContainers sample tests
devin-ai-integration[bot] May 19, 2025
bc628f6
Add schema-test.sql to reset database sequence for tests
devin-ai-integration[bot] May 19, 2025
8f69bac
Merge branch 'master' into devin/1747645402-add-docker-compose-sample
making May 19, 2025
ccbb570
Address PR feedback: Move sequence reset to test code, update logging…
devin-ai-integration[bot] May 19, 2025
0090fb5
Remove test application.properties as it's redundant with main applic…
devin-ai-integration[bot] May 19, 2025
b616f81
Add TestContainers fallback for Docker Compose sample in CI
devin-ai-integration[bot] May 19, 2025
bd35370
Format DockerComposeTestConfiguration.java
devin-ai-integration[bot] May 19, 2025
a68bdde
Revert "Format DockerComposeTestConfiguration.java"
making May 19, 2025
10064a2
Revert "Add TestContainers fallback for Docker Compose sample in CI"
making May 19, 2025
739caf8
update
making May 19, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,6 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ spring.sql.init.mode=always

# Doma configuration
doma.dialect=POSTGRES
logging.level.org.springframework.jdbc.datasource.DataSourceTransactionManager=DEBUG
logging.level.org.springframework.jdbc.support.JdbcTransactionManager=DEBUG
logging.level.org.seasar.doma.jdbc=DEBUG
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.web.server.LocalServerPort;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.client.RestClient;
import org.springframework.web.util.UriComponentsBuilder;

Expand All @@ -22,8 +23,15 @@ class ApplicationTest {
@LocalServerPort
private int port;

@Autowired
private JdbcTemplate jdbcTemplate;

@BeforeEach
void setUp(@Autowired RestClient.Builder restClientBuilder) {
jdbcTemplate.update("DROP TABLE IF EXISTS messages");
jdbcTemplate.update("CREATE TABLE messages (id SERIAL PRIMARY KEY, text VARCHAR(255))");
jdbcTemplate.update("ALTER SEQUENCE messages_id_seq RESTART WITH 1");

this.restClient = restClientBuilder
.baseUrl("http://localhost:" + port)
.defaultStatusHandler(__ -> true, (req, res) -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
# Enable Docker Compose in tests
spring.docker.compose.skip.in-tests=false
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove src/test/resources/application.properties. Using src/main/resources/application.properties should be sufficient

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move spring.docker.compose.skip.in-tests=false to src/main/resources/application.properties

spring.sql.init.mode=always
spring.sql.init.schema-locations=classpath:schema-test.sql

# Database configuration
spring.datasource.url=jdbc:postgresql://localhost:5432/mydatabase
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spring.datasource.* props are useless as these are automatically resolved via Docker Compose based JdbcConnectionDetails

spring.datasource.username=myuser
spring.datasource.password=secret

# Logging configuration
logging.level.org.springframework.jdbc.datasource.DataSourceTransactionManager=DEBUG
logging.level.org.springframework.jdbc.support.JdbcTransactionManager=DEBUG
logging.level.org.seasar.doma=DEBUG

This file was deleted.