File tree Expand file tree Collapse file tree
src/test/java/com/xpeho/spring_boot_java_random_user/presentation Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,3 +8,8 @@ LB_CHANGELOG=your_changelog_file.yaml
88LB_OUTPUT_CHANGELOG = your_output_changelog.yaml
99LB_DRIVER = your_jdbc_driver_class
1010LB_SCHEMA = your_database_schema
11+
12+ # H2 configuration
13+ H2_URL = your_h2_url
14+ H2_USERNAME = your_h2_username
15+ H2_PASSWORD = your_h2_password
Original file line number Diff line number Diff line change 1- version : ' 3.8'
2-
31services :
42 postgres :
5- image : postgres:17.9 -alpine
3+ image : postgres:17-alpine
64 container_name : xpeho_postgres
75 environment :
86 POSTGRES_USER : ${POSTGRES_USER}
Original file line number Diff line number Diff line change 2828 </scm >
2929 <properties >
3030 <java .version>25</java .version>
31- <testcontainers .version>1.19.8 </testcontainers .version>
31+ <testcontainers .version>2.0.4 </testcontainers .version>
3232 <skipDocker >false</skipDocker >
3333 <sonar .coverage.exclusions>**/*Application.java</sonar .coverage.exclusions>
3434 <sonar .test.exclusions>**/feature/SpringIntegrationTest.java</sonar .test.exclusions>
137137 </dependency >
138138 <dependency >
139139 <groupId >org.testcontainers</groupId >
140- <artifactId >junit-jupiter</artifactId >
140+ <artifactId >testcontainers- junit-jupiter</artifactId >
141141 <scope >test</scope >
142142 </dependency >
143143 <dependency >
144144 <groupId >org.testcontainers</groupId >
145- <artifactId >postgresql</artifactId >
145+ <artifactId >testcontainers- postgresql</artifactId >
146146 <scope >test</scope >
147147 </dependency >
148148 <dependency >
Original file line number Diff line number Diff line change 1313import org .springframework .boot .resttestclient .TestRestTemplate ;
1414import org .springframework .http .HttpStatus ;
1515import org .springframework .http .ResponseEntity ;
16- import org . springframework . test . context . ActiveProfiles ;
17- import org .testcontainers .containers .PostgreSQLContainer ;
16+
17+ import org .testcontainers .postgresql .PostgreSQLContainer ;
1818import org .testcontainers .junit .jupiter .Container ;
1919import org .testcontainers .junit .jupiter .Testcontainers ;
2020
2121import static org .assertj .core .api .Assertions .assertThat ;
2222
2323@ Testcontainers
2424@ AutoConfigureTestRestTemplate
25- @ ActiveProfiles ("test" )
2625@ SpringBootTest (
2726 webEnvironment = SpringBootTest .WebEnvironment .RANDOM_PORT ,
2827 properties = {
@@ -34,7 +33,7 @@ class UserGetByIdContainerTest {
3433
3534 @ Container
3635 @ ServiceConnection
37- static PostgreSQLContainer <?> postgres = new PostgreSQLContainer <>("postgres:16 -alpine" );
36+ static PostgreSQLContainer <?> postgres = new PostgreSQLContainer <>("postgres:17 -alpine" );
3837
3938 @ Autowired
4039 private TestRestTemplate restTemplate ;
You can’t perform that action at this time.
0 commit comments