mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Merge branch '2.3.x'
Closes gh-24104
This commit is contained in:
commit
b6fc0913cf
@ -85,7 +85,7 @@ class CassandraAutoConfigurationWithPasswordAuthenticationIntegrationTests {
|
|||||||
extends CassandraContainer<PasswordAuthenticatorCassandraContainer> {
|
extends CassandraContainer<PasswordAuthenticatorCassandraContainer> {
|
||||||
|
|
||||||
PasswordAuthenticatorCassandraContainer() {
|
PasswordAuthenticatorCassandraContainer() {
|
||||||
super(DockerImageNames.cassandra().toString());
|
super(DockerImageNames.cassandra());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -47,7 +47,7 @@ class CouchbaseAutoConfigurationIntegrationTests {
|
|||||||
private static final String BUCKET_NAME = "cbbucket";
|
private static final String BUCKET_NAME = "cbbucket";
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static final CouchbaseContainer couchbase = new CouchbaseContainer(DockerImageNames.couchbase().toString())
|
static final CouchbaseContainer couchbase = new CouchbaseContainer(DockerImageNames.couchbase())
|
||||||
.withCredentials("spring", "password").withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10))
|
.withCredentials("spring", "password").withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10))
|
||||||
.withBucket(new BucketDefinition(BUCKET_NAME).withPrimaryIndex(false));
|
.withBucket(new BucketDefinition(BUCKET_NAME).withPrimaryIndex(false));
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
class CassandraDataAutoConfigurationIntegrationTests {
|
class CassandraDataAutoConfigurationIntegrationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static final CassandraContainer<?> cassandra = new CassandraContainer<>(DockerImageNames.cassandra().toString())
|
static final CassandraContainer<?> cassandra = new CassandraContainer<>(DockerImageNames.cassandra())
|
||||||
.withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10));
|
.withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10));
|
||||||
|
|
||||||
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
||||||
|
@ -49,9 +49,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
class ElasticsearchRepositoriesAutoConfigurationTests {
|
class ElasticsearchRepositoriesAutoConfigurationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static final ElasticsearchContainer elasticsearch = new ElasticsearchContainer(
|
static final ElasticsearchContainer elasticsearch = new ElasticsearchContainer(DockerImageNames.elasticsearch())
|
||||||
DockerImageNames.elasticsearch().toString()).withStartupAttempts(5)
|
.withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10));
|
||||||
.withStartupTimeout(Duration.ofMinutes(10));
|
|
||||||
|
|
||||||
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
||||||
.withConfiguration(AutoConfigurations.of(ElasticsearchRestClientAutoConfiguration.class,
|
.withConfiguration(AutoConfigurations.of(ElasticsearchRestClientAutoConfiguration.class,
|
||||||
|
@ -48,9 +48,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
public class ReactiveElasticsearchRepositoriesAutoConfigurationTests {
|
public class ReactiveElasticsearchRepositoriesAutoConfigurationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static ElasticsearchContainer elasticsearch = new ElasticsearchContainer(
|
static ElasticsearchContainer elasticsearch = new ElasticsearchContainer(DockerImageNames.elasticsearch())
|
||||||
DockerImageNames.elasticsearch().toString()).withStartupAttempts(5)
|
.withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10));
|
||||||
.withStartupTimeout(Duration.ofMinutes(10));
|
|
||||||
|
|
||||||
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
||||||
.withConfiguration(AutoConfigurations.of(ReactiveElasticsearchRestClientAutoConfiguration.class,
|
.withConfiguration(AutoConfigurations.of(ReactiveElasticsearchRestClientAutoConfiguration.class,
|
||||||
|
@ -48,9 +48,8 @@ import static org.mockito.Mockito.mock;
|
|||||||
public class ReactiveElasticsearchRestClientAutoConfigurationTests {
|
public class ReactiveElasticsearchRestClientAutoConfigurationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static ElasticsearchContainer elasticsearch = new ElasticsearchContainer(
|
static ElasticsearchContainer elasticsearch = new ElasticsearchContainer(DockerImageNames.elasticsearch())
|
||||||
DockerImageNames.elasticsearch().toString()).withStartupAttempts(5)
|
.withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10));
|
||||||
.withStartupTimeout(Duration.ofMinutes(10));
|
|
||||||
|
|
||||||
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
||||||
.withConfiguration(AutoConfigurations.of(ReactiveElasticsearchRestClientAutoConfiguration.class));
|
.withConfiguration(AutoConfigurations.of(ReactiveElasticsearchRestClientAutoConfiguration.class));
|
||||||
|
@ -44,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
public class Neo4jRepositoriesAutoConfigurationIntegrationTests {
|
public class Neo4jRepositoriesAutoConfigurationIntegrationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
private static final Neo4jContainer<?> neo4jServer = new Neo4jContainer<>(DockerImageNames.neo4j().toString());
|
private static final Neo4jContainer<?> neo4jServer = new Neo4jContainer<>(DockerImageNames.neo4j());
|
||||||
|
|
||||||
@DynamicPropertySource
|
@DynamicPropertySource
|
||||||
static void neo4jProperties(DynamicPropertyRegistry registry) {
|
static void neo4jProperties(DynamicPropertyRegistry registry) {
|
||||||
|
@ -59,9 +59,8 @@ import static org.mockito.Mockito.mock;
|
|||||||
class ElasticsearchRestClientAutoConfigurationTests {
|
class ElasticsearchRestClientAutoConfigurationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static final ElasticsearchContainer elasticsearch = new ElasticsearchContainer(
|
static final ElasticsearchContainer elasticsearch = new ElasticsearchContainer(DockerImageNames.elasticsearch())
|
||||||
DockerImageNames.elasticsearch().toString()).withStartupAttempts(5)
|
.withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10));
|
||||||
.withStartupTimeout(Duration.ofMinutes(10));
|
|
||||||
|
|
||||||
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
||||||
.withConfiguration(AutoConfigurations.of(ElasticsearchRestClientAutoConfiguration.class));
|
.withConfiguration(AutoConfigurations.of(ElasticsearchRestClientAutoConfiguration.class));
|
||||||
|
@ -46,7 +46,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
class Neo4jAutoConfigurationIntegrationTests {
|
class Neo4jAutoConfigurationIntegrationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
private static final Neo4jContainer<?> neo4jServer = new Neo4jContainer<>(DockerImageNames.neo4j().toString());
|
private static final Neo4jContainer<?> neo4jServer = new Neo4jContainer<>(DockerImageNames.neo4j());
|
||||||
|
|
||||||
@DynamicPropertySource
|
@DynamicPropertySource
|
||||||
static void neo4jProperties(DynamicPropertyRegistry registry) {
|
static void neo4jProperties(DynamicPropertyRegistry registry) {
|
||||||
|
@ -48,8 +48,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
class SessionAutoConfigurationMongoTests extends AbstractSessionAutoConfigurationTests {
|
class SessionAutoConfigurationMongoTests extends AbstractSessionAutoConfigurationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static final MongoDBContainer mongoDB = new MongoDBContainer(DockerImageNames.mongo().toString())
|
static final MongoDBContainer mongoDB = new MongoDBContainer(DockerImageNames.mongo()).withStartupAttempts(5)
|
||||||
.withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(5));
|
.withStartupTimeout(Duration.ofMinutes(5));
|
||||||
|
|
||||||
private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
|
private final WebApplicationContextRunner contextRunner = new WebApplicationContextRunner()
|
||||||
.withConfiguration(AutoConfigurations.of(MongoAutoConfiguration.class, MongoDataAutoConfiguration.class,
|
.withConfiguration(AutoConfigurations.of(MongoAutoConfiguration.class, MongoDataAutoConfiguration.class,
|
||||||
|
@ -156,7 +156,7 @@ bom {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
library("Testcontainers", "1.14.3") {
|
library("Testcontainers", "1.15.0") {
|
||||||
group("org.testcontainers") {
|
group("org.testcontainers") {
|
||||||
imports = [
|
imports = [
|
||||||
"testcontainers-bom"
|
"testcontainers-bom"
|
||||||
|
@ -53,7 +53,7 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
|||||||
class DataCassandraTestIntegrationTests {
|
class DataCassandraTestIntegrationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static final CassandraContainer<?> cassandra = new CassandraContainer<>(DockerImageNames.cassandra().toString())
|
static final CassandraContainer<?> cassandra = new CassandraContainer<>(DockerImageNames.cassandra())
|
||||||
.withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10));
|
.withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10));
|
||||||
|
|
||||||
@DynamicPropertySource
|
@DynamicPropertySource
|
||||||
|
@ -52,7 +52,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
class DataCassandraTestWithIncludeFilterIntegrationTests {
|
class DataCassandraTestWithIncludeFilterIntegrationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static final CassandraContainer<?> cassandra = new CassandraContainer<>(DockerImageNames.cassandra().toString())
|
static final CassandraContainer<?> cassandra = new CassandraContainer<>(DockerImageNames.cassandra())
|
||||||
.withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10));
|
.withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(10));
|
||||||
|
|
||||||
@DynamicPropertySource
|
@DynamicPropertySource
|
||||||
|
@ -44,8 +44,8 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
|||||||
class DataMongoTestIntegrationTests {
|
class DataMongoTestIntegrationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static final MongoDBContainer mongoDB = new MongoDBContainer(DockerImageNames.mongo().toString())
|
static final MongoDBContainer mongoDB = new MongoDBContainer(DockerImageNames.mongo()).withStartupAttempts(5)
|
||||||
.withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(5));
|
.withStartupTimeout(Duration.ofMinutes(5));
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MongoTemplate mongoTemplate;
|
private MongoTemplate mongoTemplate;
|
||||||
|
@ -41,8 +41,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
class DataMongoTestReactiveIntegrationTests {
|
class DataMongoTestReactiveIntegrationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static final MongoDBContainer mongoDB = new MongoDBContainer(DockerImageNames.mongo().toString())
|
static final MongoDBContainer mongoDB = new MongoDBContainer(DockerImageNames.mongo()).withStartupAttempts(5)
|
||||||
.withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(5));
|
.withStartupTimeout(Duration.ofMinutes(5));
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ReactiveMongoTemplate mongoTemplate;
|
private ReactiveMongoTemplate mongoTemplate;
|
||||||
|
@ -42,8 +42,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
class DataMongoTestWithIncludeFilterIntegrationTests {
|
class DataMongoTestWithIncludeFilterIntegrationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static final MongoDBContainer mongoDB = new MongoDBContainer(DockerImageNames.mongo().toString())
|
static final MongoDBContainer mongoDB = new MongoDBContainer(DockerImageNames.mongo()).withStartupAttempts(5)
|
||||||
.withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(5));
|
.withStartupTimeout(Duration.ofMinutes(5));
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ExampleService service;
|
private ExampleService service;
|
||||||
|
@ -48,8 +48,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
class TransactionalDataMongoTestIntegrationTests {
|
class TransactionalDataMongoTestIntegrationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static final MongoDBContainer mongoDB = new MongoDBContainer(DockerImageNames.mongo().toString())
|
static final MongoDBContainer mongoDB = new MongoDBContainer(DockerImageNames.mongo()).withStartupAttempts(5)
|
||||||
.withStartupAttempts(5).withStartupTimeout(Duration.ofMinutes(5));
|
.withStartupTimeout(Duration.ofMinutes(5));
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private ExampleRepository exampleRepository;
|
private ExampleRepository exampleRepository;
|
||||||
|
@ -46,8 +46,8 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
|||||||
class DataNeo4jTestIntegrationTests {
|
class DataNeo4jTestIntegrationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static final Neo4jContainer<?> neo4j = new Neo4jContainer<>(DockerImageNames.neo4j().toString())
|
static final Neo4jContainer<?> neo4j = new Neo4jContainer<>(DockerImageNames.neo4j()).withoutAuthentication()
|
||||||
.withoutAuthentication().withStartupTimeout(Duration.ofMinutes(10));
|
.withStartupTimeout(Duration.ofMinutes(10));
|
||||||
|
|
||||||
@DynamicPropertySource
|
@DynamicPropertySource
|
||||||
static void neo4jProperties(DynamicPropertyRegistry registry) {
|
static void neo4jProperties(DynamicPropertyRegistry registry) {
|
||||||
|
@ -42,8 +42,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
class DataNeo4jTestPropertiesIntegrationTests {
|
class DataNeo4jTestPropertiesIntegrationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static final Neo4jContainer<?> neo4j = new Neo4jContainer<>(DockerImageNames.neo4j().toString())
|
static final Neo4jContainer<?> neo4j = new Neo4jContainer<>(DockerImageNames.neo4j()).withoutAuthentication()
|
||||||
.withoutAuthentication().withStartupTimeout(Duration.ofMinutes(10));
|
.withStartupTimeout(Duration.ofMinutes(10));
|
||||||
|
|
||||||
@DynamicPropertySource
|
@DynamicPropertySource
|
||||||
static void neo4jProperties(DynamicPropertyRegistry registry) {
|
static void neo4jProperties(DynamicPropertyRegistry registry) {
|
||||||
|
@ -55,8 +55,8 @@ import static org.assertj.core.api.Assertions.assertThatExceptionOfType;
|
|||||||
class DataNeo4jTestReactiveIntegrationTests {
|
class DataNeo4jTestReactiveIntegrationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static final Neo4jContainer<?> neo4j = new Neo4jContainer<>(DockerImageNames.neo4j().toString())
|
static final Neo4jContainer<?> neo4j = new Neo4jContainer<>(DockerImageNames.neo4j()).withoutAuthentication()
|
||||||
.withoutAuthentication().withStartupTimeout(Duration.ofMinutes(10));
|
.withStartupTimeout(Duration.ofMinutes(10));
|
||||||
|
|
||||||
@DynamicPropertySource
|
@DynamicPropertySource
|
||||||
static void neo4jProperties(DynamicPropertyRegistry registry) {
|
static void neo4jProperties(DynamicPropertyRegistry registry) {
|
||||||
|
@ -43,8 +43,8 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
class DataNeo4jTestWithIncludeFilterIntegrationTests {
|
class DataNeo4jTestWithIncludeFilterIntegrationTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static final Neo4jContainer<?> neo4j = new Neo4jContainer<>(DockerImageNames.neo4j().toString())
|
static final Neo4jContainer<?> neo4j = new Neo4jContainer<>(DockerImageNames.neo4j()).withoutAuthentication()
|
||||||
.withoutAuthentication().withStartupTimeout(Duration.ofMinutes(10));
|
.withStartupTimeout(Duration.ofMinutes(10));
|
||||||
|
|
||||||
@DynamicPropertySource
|
@DynamicPropertySource
|
||||||
static void neo4jProperties(DynamicPropertyRegistry registry) {
|
static void neo4jProperties(DynamicPropertyRegistry registry) {
|
||||||
|
@ -105,7 +105,7 @@ public class BootBuildImageRegistryIntegrationTests {
|
|||||||
private static class RegistryContainer extends GenericContainer<RegistryContainer> {
|
private static class RegistryContainer extends GenericContainer<RegistryContainer> {
|
||||||
|
|
||||||
RegistryContainer() {
|
RegistryContainer() {
|
||||||
super(DockerImageNames.registry().toString());
|
super(DockerImageNames.registry());
|
||||||
addExposedPorts(5000);
|
addExposedPorts(5000);
|
||||||
addEnv("SERVER_NAME", "localhost");
|
addEnv("SERVER_NAME", "localhost");
|
||||||
}
|
}
|
||||||
|
@ -80,7 +80,7 @@ public class BuildImageRegistryIntegrationTests extends AbstractArchiveIntegrati
|
|||||||
private static class RegistryContainer extends GenericContainer<RegistryContainer> {
|
private static class RegistryContainer extends GenericContainer<RegistryContainer> {
|
||||||
|
|
||||||
RegistryContainer() {
|
RegistryContainer() {
|
||||||
super(DockerImageNames.registry().toString());
|
super(DockerImageNames.registry());
|
||||||
addExposedPorts(5000);
|
addExposedPorts(5000);
|
||||||
addEnv("SERVER_NAME", "localhost");
|
addEnv("SERVER_NAME", "localhost");
|
||||||
}
|
}
|
||||||
|
@ -48,7 +48,7 @@ public final class DockerImageNames {
|
|||||||
* @return a docker image name for running cassandra
|
* @return a docker image name for running cassandra
|
||||||
*/
|
*/
|
||||||
public static DockerImageName cassandra() {
|
public static DockerImageName cassandra() {
|
||||||
return new DockerImageName("cassandra", CASSANDRA_VERSION);
|
return DockerImageName.parse("cassandra").withTag(CASSANDRA_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -56,7 +56,7 @@ public final class DockerImageNames {
|
|||||||
* @return a docker image name for running cassandra
|
* @return a docker image name for running cassandra
|
||||||
*/
|
*/
|
||||||
public static DockerImageName couchbase() {
|
public static DockerImageName couchbase() {
|
||||||
return new DockerImageName("couchbase/server", COUCHBASE_VERSION);
|
return DockerImageName.parse("couchbase/server").withTag(COUCHBASE_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -66,7 +66,7 @@ public final class DockerImageNames {
|
|||||||
*/
|
*/
|
||||||
public static DockerImageName elasticsearch() {
|
public static DockerImageName elasticsearch() {
|
||||||
String version = org.elasticsearch.Version.CURRENT.toString();
|
String version = org.elasticsearch.Version.CURRENT.toString();
|
||||||
return new DockerImageName("docker.elastic.co/elasticsearch/elasticsearch", version);
|
return DockerImageName.parse("docker.elastic.co/elasticsearch/elasticsearch").withTag(version);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -74,7 +74,7 @@ public final class DockerImageNames {
|
|||||||
* @return a docker image name for running mongo
|
* @return a docker image name for running mongo
|
||||||
*/
|
*/
|
||||||
public static DockerImageName mongo() {
|
public static DockerImageName mongo() {
|
||||||
return new DockerImageName("mongo", MONGO_VERSION);
|
return DockerImageName.parse("mongo").withTag(MONGO_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -82,7 +82,7 @@ public final class DockerImageNames {
|
|||||||
* @return a docker image name for running neo4j
|
* @return a docker image name for running neo4j
|
||||||
*/
|
*/
|
||||||
public static DockerImageName neo4j() {
|
public static DockerImageName neo4j() {
|
||||||
return new DockerImageName("neo4j", NEO4J_VERSION);
|
return DockerImageName.parse("neo4j").withTag(NEO4J_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -90,7 +90,7 @@ public final class DockerImageNames {
|
|||||||
* @return a docker image name for running postgresql
|
* @return a docker image name for running postgresql
|
||||||
*/
|
*/
|
||||||
public static DockerImageName postgresql() {
|
public static DockerImageName postgresql() {
|
||||||
return new DockerImageName("postgres", POSTGRESQL_VERSION);
|
return DockerImageName.parse("postgres").withTag(POSTGRESQL_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -98,15 +98,16 @@ public final class DockerImageNames {
|
|||||||
* @return a docker image name for running redis
|
* @return a docker image name for running redis
|
||||||
*/
|
*/
|
||||||
public static DockerImageName redis() {
|
public static DockerImageName redis() {
|
||||||
return new DockerImageName("redis", REDIS_VERSION);
|
return DockerImageName.parse("redis").withTag(REDIS_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a {@link DockerImageName} suitable for running a Docker registry.
|
* Return a {@link DockerImageName} suitable for running a Docker registry.
|
||||||
* @return a docker image name for running a registry
|
* @return a docker image name for running a registry
|
||||||
|
* @since 2.4.0
|
||||||
*/
|
*/
|
||||||
public static DockerImageName registry() {
|
public static DockerImageName registry() {
|
||||||
return new DockerImageName("registry", REGISTRY_VERSION);
|
return DockerImageName.parse("registry").withTag(REGISTRY_VERSION);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -28,7 +28,7 @@ import org.testcontainers.containers.GenericContainer;
|
|||||||
public class RedisContainer extends GenericContainer<RedisContainer> {
|
public class RedisContainer extends GenericContainer<RedisContainer> {
|
||||||
|
|
||||||
public RedisContainer() {
|
public RedisContainer() {
|
||||||
super(DockerImageNames.redis().toString());
|
super(DockerImageNames.redis());
|
||||||
addExposedPorts(6379);
|
addExposedPorts(6379);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
class CityRepositoryTests {
|
class CityRepositoryTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static PostgreSQLContainer<?> postgresql = new PostgreSQLContainer<>(DockerImageNames.postgresql().toString())
|
static PostgreSQLContainer<?> postgresql = new PostgreSQLContainer<>(DockerImageNames.postgresql())
|
||||||
.withDatabaseName("test_flyway");
|
.withDatabaseName("test_flyway");
|
||||||
|
|
||||||
@DynamicPropertySource
|
@DynamicPropertySource
|
||||||
|
@ -38,7 +38,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||||||
class CityRepositoryTests {
|
class CityRepositoryTests {
|
||||||
|
|
||||||
@Container
|
@Container
|
||||||
static PostgreSQLContainer<?> postgresql = new PostgreSQLContainer<>(DockerImageNames.postgresql().toString())
|
static PostgreSQLContainer<?> postgresql = new PostgreSQLContainer<>(DockerImageNames.postgresql())
|
||||||
.withDatabaseName("test_liquibase");
|
.withDatabaseName("test_liquibase");
|
||||||
|
|
||||||
@DynamicPropertySource
|
@DynamicPropertySource
|
||||||
|
Loading…
Reference in New Issue
Block a user