File tree Expand file tree Collapse file tree 4 files changed +6
-4
lines changed
src/test/java/org/springframework/samples/petclinic Expand file tree Collapse file tree 4 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ A similar setup is provided for MySQL and PostgreSQL if a persistent database co
5454You can start MySQL or PostgreSQL locally with whatever installer works for your OS or use docker:
5555
5656``` bash
57- docker run -e MYSQL_USER=petclinic -e MYSQL_PASSWORD=petclinic -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=petclinic -p 3306:3306 mysql:9.3
57+ docker run -e MYSQL_USER=petclinic -e MYSQL_PASSWORD=petclinic -e MYSQL_ROOT_PASSWORD=root -e MYSQL_DATABASE=petclinic -p 3306:3306 mysql:9.2
5858```
5959
6060or
Original file line number Diff line number Diff line change 11services :
22 mysql :
3- image : mysql:9.3
3+ image : mysql:9.2
44 ports :
55 - " 3306:3306"
66 environment :
Original file line number Diff line number Diff line change 3636import org .testcontainers .containers .MySQLContainer ;
3737import org .testcontainers .junit .jupiter .Container ;
3838import org .testcontainers .junit .jupiter .Testcontainers ;
39+ import org .testcontainers .utility .DockerImageName ;
3940
4041@ SpringBootTest (webEnvironment = WebEnvironment .RANDOM_PORT )
4142@ ActiveProfiles ("mysql" )
@@ -46,7 +47,7 @@ class MySqlIntegrationTests {
4647
4748 @ ServiceConnection
4849 @ Container
49- static MySQLContainer <?> container = new MySQLContainer <>("mysql:9.3" );
50+ static MySQLContainer <?> container = new MySQLContainer <>(DockerImageName . parse ( "mysql:9.2" ) );
5051
5152 @ LocalServerPort
5253 int port ;
Original file line number Diff line number Diff line change 2222import org .springframework .context .annotation .Configuration ;
2323import org .springframework .context .annotation .Profile ;
2424import org .testcontainers .containers .MySQLContainer ;
25+ import org .testcontainers .utility .DockerImageName ;
2526
2627/**
2728 * PetClinic Spring Boot Application.
@@ -35,7 +36,7 @@ public class MysqlTestApplication {
3536 @ Profile ("mysql" )
3637 @ Bean
3738 static MySQLContainer <?> container () {
38- return new MySQLContainer <>("mysql:9.3" );
39+ return new MySQLContainer <>(DockerImageName . parse ( "mysql:9.2" ) );
3940 }
4041
4142 public static void main (String [] args ) {
You can’t perform that action at this time.
0 commit comments