Skip to content

Commit cb3874f

Browse files
committed
Merge branch '3.4.x'
2 parents 91c83cb + 6567609 commit cb3874f

File tree

5 files changed

+14
-25
lines changed

5 files changed

+14
-25
lines changed

spring-boot-project/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/service/connection/oracle/OracleFreeJdbcDockerComposeConnectionDetailsFactoryIntegrationTests.java

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,13 +20,11 @@
2020
import java.time.Duration;
2121

2222
import org.awaitility.Awaitility;
23-
import org.junit.jupiter.api.condition.OS;
2423

2524
import org.springframework.boot.autoconfigure.jdbc.JdbcConnectionDetails;
2625
import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest;
2726
import org.springframework.boot.jdbc.DatabaseDriver;
2827
import org.springframework.boot.testsupport.container.TestImage;
29-
import org.springframework.boot.testsupport.junit.DisabledOnOs;
3028
import org.springframework.jdbc.core.JdbcTemplate;
3129
import org.springframework.jdbc.datasource.SimpleDriverDataSource;
3230
import org.springframework.util.ClassUtils;
@@ -38,8 +36,6 @@
3836
*
3937
* @author Andy Wilkinson
4038
*/
41-
@DisabledOnOs(os = { OS.LINUX, OS.MAC }, architecture = "aarch64",
42-
disabledReason = "The Oracle image has no ARM support")
4339
class OracleFreeJdbcDockerComposeConnectionDetailsFactoryIntegrationTests {
4440

4541
@SuppressWarnings("unchecked")

spring-boot-project/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/service/connection/oracle/OracleFreeR2dbcDockerComposeConnectionDetailsFactoryIntegrationTests.java

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -21,13 +21,11 @@
2121
import io.r2dbc.spi.ConnectionFactories;
2222
import io.r2dbc.spi.ConnectionFactoryOptions;
2323
import org.awaitility.Awaitility;
24-
import org.junit.jupiter.api.condition.OS;
2524

2625
import org.springframework.boot.autoconfigure.r2dbc.R2dbcConnectionDetails;
2726
import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest;
2827
import org.springframework.boot.jdbc.DatabaseDriver;
2928
import org.springframework.boot.testsupport.container.TestImage;
30-
import org.springframework.boot.testsupport.junit.DisabledOnOs;
3129
import org.springframework.r2dbc.core.DatabaseClient;
3230

3331
import static org.assertj.core.api.Assertions.assertThat;
@@ -37,8 +35,6 @@
3735
*
3836
* @author Andy Wilkinson
3937
*/
40-
@DisabledOnOs(os = { OS.LINUX, OS.MAC }, architecture = "aarch64",
41-
disabledReason = "The Oracle image has no ARM support")
4238
class OracleFreeR2dbcDockerComposeConnectionDetailsFactoryIntegrationTests {
4339

4440
@DockerComposeTest(composeFile = "oracle-compose.yaml", image = TestImage.ORACLE_FREE)

spring-boot-project/spring-boot-docker-compose/src/dockerTest/java/org/springframework/boot/docker/compose/service/connection/test/DockerComposeTestExtension.java

+10-9
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package org.springframework.boot.docker.compose.service.connection.test;
1818

1919
import java.io.IOException;
20+
import java.nio.charset.StandardCharsets;
2021
import java.nio.file.Files;
2122
import java.nio.file.Path;
2223
import java.util.LinkedHashMap;
@@ -63,9 +64,9 @@ public void beforeTestExecution(ExtensionContext context) throws Exception {
6364
Path workspace = Files.createTempDirectory("DockerComposeTestExtension-");
6465
store.put(STORE_KEY_WORKSPACE, workspace);
6566
try {
66-
Path transformedComposeFile = prepareComposeFile(workspace, context);
67+
Path composeFile = prepareComposeFile(workspace, context);
6768
copyAdditionalResources(workspace, context);
68-
SpringApplication application = prepareApplication(transformedComposeFile);
69+
SpringApplication application = prepareApplication(composeFile);
6970
store.put(STORE_KEY_APPLICATION_CONTEXT, application.run());
7071
}
7172
catch (Exception ex) {
@@ -84,11 +85,11 @@ private Path prepareComposeFile(Path workspace, ExtensionContext context) {
8485

8586
private Path transformedComposeFile(Path workspace, Resource composeFileResource, TestImage image) {
8687
try {
87-
Path composeFile = composeFileResource.getFile().toPath();
88-
String transformedContent = Files.readString(composeFile).replace("{imageName}", image.toString());
89-
Path transformedComposeFile = workspace.resolve("compose.yaml");
90-
Files.writeString(transformedComposeFile, transformedContent);
91-
return transformedComposeFile;
88+
String template = composeFileResource.getContentAsString(StandardCharsets.UTF_8);
89+
String content = template.replace("{imageName}", image.toString());
90+
Path composeFile = workspace.resolve("compose.yaml");
91+
Files.writeString(composeFile, content);
92+
return composeFile;
9293
}
9394
catch (IOException ex) {
9495
fail("Error transforming Docker compose file '" + composeFileResource + "': " + ex.getMessage(), ex);
@@ -114,11 +115,11 @@ private void copyAdditionalResource(Path workspace, Resource resource) {
114115
}
115116
}
116117

117-
private SpringApplication prepareApplication(Path transformedComposeFile) {
118+
private SpringApplication prepareApplication(Path composeFile) {
118119
SpringApplication application = new SpringApplication(Config.class);
119120
Map<String, Object> properties = new LinkedHashMap<>();
120121
properties.put("spring.docker.compose.skip.in-tests", "false");
121-
properties.put("spring.docker.compose.file", transformedComposeFile);
122+
properties.put("spring.docker.compose.file", composeFile);
122123
properties.put("spring.docker.compose.stop.command", "down");
123124
application.setDefaultProperties(properties);
124125
return application;

spring-boot-project/spring-boot-testcontainers/src/dockerTest/java/org/springframework/boot/testcontainers/service/connection/r2dbc/OracleFreeR2dbcContainerConnectionDetailsFactoryIntegrationTests.java

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2024 the original author or authors.
2+
* Copyright 2012-2025 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,7 +20,6 @@
2020

2121
import io.r2dbc.spi.ConnectionFactory;
2222
import org.junit.jupiter.api.Test;
23-
import org.junit.jupiter.api.condition.OS;
2423
import org.testcontainers.junit.jupiter.Container;
2524
import org.testcontainers.junit.jupiter.Testcontainers;
2625
import org.testcontainers.oracle.OracleContainer;
@@ -31,7 +30,6 @@
3130
import org.springframework.boot.jdbc.DatabaseDriver;
3231
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
3332
import org.springframework.boot.testsupport.container.TestImage;
34-
import org.springframework.boot.testsupport.junit.DisabledOnOs;
3533
import org.springframework.context.annotation.Configuration;
3634
import org.springframework.r2dbc.core.DatabaseClient;
3735
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
@@ -45,8 +43,6 @@
4543
*/
4644
@SpringJUnitConfig
4745
@Testcontainers(disabledWithoutDocker = true)
48-
@DisabledOnOs(os = { OS.LINUX, OS.MAC }, architecture = "aarch64",
49-
disabledReason = "The Oracle image has no ARM support")
5046
class OracleFreeR2dbcContainerConnectionDetailsFactoryIntegrationTests {
5147

5248
@Container

spring-boot-project/spring-boot-tools/spring-boot-test-support-docker/src/main/java/org/springframework/boot/testsupport/container/TestImage.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ public enum TestImage {
188188
/**
189189
* A container image suitable for testing Oracle Free.
190190
*/
191-
ORACLE_FREE("gvenzl/oracle-free", "23.3-slim", () -> org.testcontainers.oracle.OracleContainer.class,
191+
ORACLE_FREE("gvenzl/oracle-free", "23.6-slim", () -> org.testcontainers.oracle.OracleContainer.class,
192192
(container) -> ((org.testcontainers.oracle.OracleContainer) container)
193193
.withStartupTimeout(Duration.ofMinutes(2))),
194194

0 commit comments

Comments
 (0)