mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-07-05 00:56:58 +08:00
Create dedicated spring-boot-testcontainers module
Create a dedicated testcontainers module containing the service connectors code. Closes gh-34757
This commit is contained in:
parent
2951cc7594
commit
11dac5b5b7
|
@ -69,6 +69,7 @@ include "spring-boot-project:spring-boot-actuator-autoconfigure"
|
|||
include "spring-boot-project:spring-boot-devtools"
|
||||
include "spring-boot-project:spring-boot-docs"
|
||||
include "spring-boot-project:spring-boot-test"
|
||||
include "spring-boot-project:spring-boot-testcontainers"
|
||||
include "spring-boot-project:spring-boot-test-autoconfigure"
|
||||
include "spring-boot-tests:spring-boot-integration-tests:spring-boot-configuration-processor-tests"
|
||||
include "spring-boot-tests:spring-boot-integration-tests:spring-boot-launch-script-tests"
|
||||
|
|
|
@ -1179,6 +1179,7 @@ bom {
|
|||
"spring-boot",
|
||||
"spring-boot-test",
|
||||
"spring-boot-test-autoconfigure",
|
||||
"spring-boot-testcontainers",
|
||||
"spring-boot-actuator",
|
||||
"spring-boot-actuator-autoconfigure",
|
||||
"spring-boot-autoconfigure",
|
||||
|
|
|
@ -70,6 +70,7 @@ dependencies {
|
|||
implementation(project(path: ":spring-boot-project:spring-boot-tools:spring-boot-loader-tools"))
|
||||
implementation(project(path: ":spring-boot-project:spring-boot-test"))
|
||||
implementation(project(path: ":spring-boot-project:spring-boot-test-autoconfigure"))
|
||||
implementation(project(path: ":spring-boot-project:spring-boot-testcontainers"))
|
||||
implementation("ch.qos.logback:logback-classic")
|
||||
implementation("com.zaxxer:HikariCP")
|
||||
implementation("io.micrometer:micrometer-core")
|
||||
|
|
|
@ -21,8 +21,8 @@ import org.testcontainers.containers.Neo4jContainer;
|
|||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
import org.springframework.boot.test.autoconfigure.neo4j.Neo4jServiceConnection;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.testcontainers.service.connection.neo4j.Neo4jServiceConnection;
|
||||
|
||||
@SpringBootTest
|
||||
@Testcontainers
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
package org.springframework.boot.docs.howto.testing.testcontainers.serviceconnection
|
||||
|
||||
import org.junit.jupiter.api.Test
|
||||
import org.springframework.boot.test.autoconfigure.neo4j.Neo4jServiceConnection;
|
||||
import org.springframework.boot.test.context.SpringBootTest
|
||||
import org.springframework.boot.testcontainers.service.connection.neo4j.Neo4jServiceConnection;
|
||||
import org.springframework.test.context.DynamicPropertyRegistry
|
||||
import org.springframework.test.context.DynamicPropertySource
|
||||
import org.testcontainers.containers.Neo4jContainer
|
||||
|
|
|
@ -60,26 +60,12 @@ dependencies {
|
|||
optional("org.apache.tomcat.embed:tomcat-embed-core")
|
||||
optional("org.mongodb:mongodb-driver-reactivestreams")
|
||||
optional("org.mongodb:mongodb-driver-sync")
|
||||
optional("org.testcontainers:cassandra")
|
||||
optional("org.testcontainers:couchbase")
|
||||
optional("org.testcontainers:elasticsearch")
|
||||
optional("org.testcontainers:influxdb")
|
||||
optional("org.testcontainers:jdbc")
|
||||
optional("org.testcontainers:kafka")
|
||||
optional("org.testcontainers:mariadb")
|
||||
optional("org.testcontainers:mongodb")
|
||||
optional("org.testcontainers:mssqlserver")
|
||||
optional("org.testcontainers:mysql")
|
||||
optional("org.testcontainers:neo4j")
|
||||
optional("org.testcontainers:postgresql")
|
||||
optional("org.testcontainers:rabbitmq")
|
||||
optional("org.testcontainers:r2dbc")
|
||||
optional("org.testcontainers:testcontainers")
|
||||
optional("io.micrometer:micrometer-tracing")
|
||||
|
||||
testImplementation(project(":spring-boot-project:spring-boot-actuator"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-actuator-autoconfigure"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-testcontainers"))
|
||||
testImplementation("ch.qos.logback:logback-classic")
|
||||
testImplementation("com.fasterxml.jackson.module:jackson-module-parameter-names")
|
||||
testImplementation("com.h2database:h2")
|
||||
|
@ -100,7 +86,6 @@ dependencies {
|
|||
testImplementation("org.eclipse:yasson")
|
||||
testImplementation("org.hibernate.validator:hibernate-validator")
|
||||
testImplementation("org.hsqldb:hsqldb")
|
||||
testImplementation("org.influxdb:influxdb-java")
|
||||
testImplementation("org.jooq:jooq") {
|
||||
exclude group: "javax.xml.bind", module: "jaxb-api"
|
||||
}
|
||||
|
@ -111,11 +96,15 @@ dependencies {
|
|||
testImplementation("org.mockito:mockito-junit-jupiter")
|
||||
testImplementation("org.skyscreamer:jsonassert")
|
||||
testImplementation("org.springframework:spring-core-test")
|
||||
testImplementation("org.springframework.amqp:spring-rabbit")
|
||||
testImplementation("org.springframework.hateoas:spring-hateoas")
|
||||
testImplementation("org.springframework.kafka:spring-kafka")
|
||||
testImplementation("org.springframework.plugin:spring-plugin-core")
|
||||
testImplementation("org.testcontainers:cassandra")
|
||||
testImplementation("org.testcontainers:couchbase")
|
||||
testImplementation("org.testcontainers:elasticsearch")
|
||||
testImplementation("org.testcontainers:junit-jupiter")
|
||||
testImplementation("org.testcontainers:mongodb")
|
||||
testImplementation("org.testcontainers:neo4j")
|
||||
testImplementation("org.testcontainers:testcontainers")
|
||||
testImplementation("org.thymeleaf:thymeleaf")
|
||||
}
|
||||
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Auto-configuration for using Flyway in tests.
|
||||
*/
|
||||
package org.springframework.boot.test.autoconfigure.flyway;
|
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Auto-configuration for using InfluxDB in tests.
|
||||
*/
|
||||
package org.springframework.boot.test.autoconfigure.influx;
|
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Auto-configuration for using Kafka in tests.
|
||||
*/
|
||||
package org.springframework.boot.test.autoconfigure.kafka;
|
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Auto-configuration for using Liquibase in tests.
|
||||
*/
|
||||
package org.springframework.boot.test.autoconfigure.liquibase;
|
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Auto-configuration for using Mongo in tests.
|
||||
*/
|
||||
package org.springframework.boot.test.autoconfigure.mongo;
|
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Auto-configuration for using Neo4j in tests.
|
||||
*/
|
||||
package org.springframework.boot.test.autoconfigure.neo4j;
|
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Auto-configuration for using R2DBC in tests.
|
||||
*/
|
||||
package org.springframework.boot.test.autoconfigure.r2dbc;
|
|
@ -4,7 +4,6 @@ org.springframework.boot.test.autoconfigure.OverrideAutoConfigurationContextCust
|
|||
org.springframework.boot.test.autoconfigure.actuate.observability.ObservabilityContextCustomizerFactory,\
|
||||
org.springframework.boot.test.autoconfigure.filter.TypeExcludeFiltersContextCustomizerFactory,\
|
||||
org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizerFactory,\
|
||||
org.springframework.boot.test.autoconfigure.service.connection.ServiceConnectionContextCustomizerFactory,\
|
||||
org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory
|
||||
|
||||
# Spring Test Execution Listeners
|
||||
|
@ -19,21 +18,3 @@ org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceSer
|
|||
org.springframework.test.context.ApplicationContextFailureProcessor=\
|
||||
org.springframework.boot.test.autoconfigure.ConditionReportApplicationContextFailureProcessor
|
||||
|
||||
# Connection Details Factories
|
||||
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
|
||||
org.springframework.boot.test.autoconfigure.amqp.RabbitContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.test.autoconfigure.cassandra.CassandraContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.test.autoconfigure.couchbase.CouchbaseContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.test.autoconfigure.data.redis.RedisContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.test.autoconfigure.elasticsearch.ElasticsearchContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.test.autoconfigure.flyway.FlywayContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.test.autoconfigure.influx.InfluxDbContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.test.autoconfigure.jdbc.JdbcContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.test.autoconfigure.kafka.KafkaContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.test.autoconfigure.liquibase.LiquibaseContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.test.autoconfigure.mongo.MongoContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.test.autoconfigure.neo4j.Neo4jContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.test.autoconfigure.r2dbc.MariaDbR2dbcContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.test.autoconfigure.r2dbc.MySqlR2dbcContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.test.autoconfigure.r2dbc.PostgresR2dbcContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.test.autoconfigure.r2dbc.SqlServerR2dbcContainerConnectionDetailsFactory
|
||||
|
|
|
@ -26,9 +26,9 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
|||
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.cassandra.CassandraServiceConnection;
|
||||
import org.springframework.boot.test.autoconfigure.data.redis.ExampleService;
|
||||
import org.springframework.boot.test.context.TestConfiguration;
|
||||
import org.springframework.boot.testcontainers.service.connection.cassandra.CassandraServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.CassandraContainer;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
|
|
@ -25,8 +25,8 @@ import org.testcontainers.junit.jupiter.Container;
|
|||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.cassandra.CassandraServiceConnection;
|
||||
import org.springframework.boot.test.context.TestConfiguration;
|
||||
import org.springframework.boot.testcontainers.service.connection.cassandra.CassandraServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.CassandraContainer;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan.Filter;
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
|||
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.couchbase.CouchbaseServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.couchbase.CouchbaseServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.data.couchbase.core.CouchbaseTemplate;
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.testcontainers.junit.jupiter.Container;
|
|||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.couchbase.CouchbaseServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.couchbase.CouchbaseServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
import org.springframework.data.couchbase.core.ReactiveCouchbaseTemplate;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.testcontainers.junit.jupiter.Container;
|
|||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.couchbase.CouchbaseServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.couchbase.CouchbaseServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
import org.springframework.context.annotation.ComponentScan.Filter;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
|
@ -26,7 +26,7 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
|||
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.elasticsearch.ElasticsearchServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.elasticsearch.ElasticsearchServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.data.elasticsearch.client.elc.ElasticsearchTemplate;
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.testcontainers.junit.jupiter.Container;
|
|||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.elasticsearch.ElasticsearchServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.elasticsearch.ElasticsearchServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.testcontainers.junit.jupiter.Container;
|
|||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.elasticsearch.ElasticsearchServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.elasticsearch.ElasticsearchServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
import org.springframework.data.elasticsearch.client.elc.ReactiveElasticsearchTemplate;
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.testcontainers.junit.jupiter.Container;
|
|||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.elasticsearch.ElasticsearchServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.elasticsearch.ElasticsearchServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
import org.springframework.context.annotation.ComponentScan.Filter;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
|||
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.mongo.MongoServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.mongo.MongoServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.data.mongodb.core.MongoTemplate;
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.testcontainers.junit.jupiter.Container;
|
|||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.mongo.MongoServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.mongo.MongoServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
import org.springframework.data.mongodb.core.ReactiveMongoTemplate;
|
||||
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.testcontainers.junit.jupiter.Container;
|
|||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.mongo.MongoServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.mongo.MongoServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
import org.springframework.context.annotation.ComponentScan.Filter;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
|
@ -25,8 +25,8 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
|||
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.mongo.MongoServiceConnection;
|
||||
import org.springframework.boot.test.context.TestConfiguration;
|
||||
import org.springframework.boot.testcontainers.service.connection.mongo.MongoServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.data.mongodb.MongoDatabaseFactory;
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
|||
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.neo4j.Neo4jServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.neo4j.Neo4jServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.data.neo4j.core.Neo4jTemplate;
|
||||
|
|
|
@ -25,7 +25,7 @@ import org.testcontainers.junit.jupiter.Container;
|
|||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.neo4j.Neo4jServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.neo4j.Neo4jServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
||||
|
|
|
@ -28,8 +28,8 @@ import reactor.test.StepVerifier;
|
|||
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.neo4j.Neo4jServiceConnection;
|
||||
import org.springframework.boot.test.context.TestConfiguration;
|
||||
import org.springframework.boot.testcontainers.service.connection.neo4j.Neo4jServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
|
|
|
@ -24,7 +24,7 @@ import org.testcontainers.junit.jupiter.Container;
|
|||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.neo4j.Neo4jServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.neo4j.Neo4jServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
import org.springframework.context.annotation.ComponentScan.Filter;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
|
@ -25,6 +25,7 @@ import org.testcontainers.junit.jupiter.Testcontainers;
|
|||
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.testcontainers.service.connection.redis.RedisServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.RedisContainer;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.data.redis.core.RedisOperations;
|
||||
|
|
|
@ -22,6 +22,7 @@ import org.testcontainers.junit.jupiter.Container;
|
|||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.testcontainers.service.connection.redis.RedisServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.RedisContainer;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ import reactor.test.StepVerifier;
|
|||
|
||||
import org.springframework.beans.factory.NoSuchBeanDefinitionException;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.testcontainers.service.connection.redis.RedisServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.RedisContainer;
|
||||
import org.springframework.context.ApplicationContext;
|
||||
import org.springframework.data.redis.core.ReactiveRedisOperations;
|
||||
|
|
|
@ -21,6 +21,7 @@ import org.testcontainers.junit.jupiter.Container;
|
|||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.testcontainers.service.connection.redis.RedisServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.RedisContainer;
|
||||
import org.springframework.context.annotation.ComponentScan.Filter;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
45
spring-boot-project/spring-boot-testcontainers/build.gradle
Normal file
45
spring-boot-project/spring-boot-testcontainers/build.gradle
Normal file
|
@ -0,0 +1,45 @@
|
|||
plugins {
|
||||
id "java-library"
|
||||
id "org.springframework.boot.conventions"
|
||||
id "org.springframework.boot.deployed"
|
||||
id "org.springframework.boot.optional-dependencies"
|
||||
}
|
||||
|
||||
description = "Spring Boot Testcontainers Support"
|
||||
|
||||
dependencies {
|
||||
api(project(":spring-boot-project:spring-boot-autoconfigure"))
|
||||
|
||||
optional("org.springframework:spring-test")
|
||||
optional("org.springframework.data:spring-data-mongodb")
|
||||
optional("org.springframework.data:spring-data-neo4j")
|
||||
optional("org.testcontainers:cassandra")
|
||||
optional("org.testcontainers:couchbase")
|
||||
optional("org.testcontainers:elasticsearch")
|
||||
optional("org.testcontainers:influxdb")
|
||||
optional("org.testcontainers:jdbc")
|
||||
optional("org.testcontainers:kafka")
|
||||
optional("org.testcontainers:mariadb")
|
||||
optional("org.testcontainers:mongodb")
|
||||
optional("org.testcontainers:mssqlserver")
|
||||
optional("org.testcontainers:mysql")
|
||||
optional("org.testcontainers:neo4j")
|
||||
optional("org.testcontainers:postgresql")
|
||||
optional("org.testcontainers:rabbitmq")
|
||||
optional("org.testcontainers:r2dbc")
|
||||
|
||||
testImplementation("ch.qos.logback:logback-classic")
|
||||
testImplementation("org.assertj:assertj-core")
|
||||
testImplementation("org.awaitility:awaitility")
|
||||
testImplementation("org.influxdb:influxdb-java")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter")
|
||||
testImplementation("org.junit.platform:junit-platform-engine")
|
||||
testImplementation("org.junit.platform:junit-platform-launcher")
|
||||
testImplementation("org.mockito:mockito-core")
|
||||
testImplementation("org.mockito:mockito-junit-jupiter")
|
||||
testImplementation("org.springframework:spring-core-test")
|
||||
testImplementation("org.springframework.amqp:spring-rabbit")
|
||||
testImplementation("org.springframework.kafka:spring-kafka")
|
||||
testImplementation("org.testcontainers:junit-jupiter")
|
||||
}
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.service.connection;
|
||||
package org.springframework.boot.testcontainers.service.connection;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Field;
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.service.connection;
|
||||
package org.springframework.boot.testcontainers.service.connection;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.service.connection;
|
||||
package org.springframework.boot.testcontainers.service.connection;
|
||||
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.lang.reflect.Field;
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.service.connection;
|
||||
package org.springframework.boot.testcontainers.service.connection;
|
||||
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.service.connection;
|
||||
package org.springframework.boot.testcontainers.service.connection;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Supplier;
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.service.connection;
|
||||
package org.springframework.boot.testcontainers.service.connection;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.lang.reflect.Modifier;
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.amqp;
|
||||
package org.springframework.boot.testcontainers.service.connection.amqp;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
|
@ -22,8 +22,8 @@ import java.util.List;
|
|||
import org.testcontainers.containers.RabbitMQContainer;
|
||||
|
||||
import org.springframework.boot.autoconfigure.amqp.RabbitConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionSource;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
|
||||
|
||||
/**
|
||||
* {@link ContainerConnectionDetailsFactory} for
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.amqp;
|
||||
package org.springframework.boot.testcontainers.service.connection.amqp;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
@ -23,7 +23,7 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.boot.autoconfigure.amqp.RabbitConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||
|
||||
/**
|
||||
* Annotation that indicates that a field provides a RabbitMQ service connection.
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Support for testcontainers RabbitMQ service connections.
|
||||
*/
|
||||
package org.springframework.boot.testcontainers.service.connection.amqp;
|
|
@ -14,15 +14,15 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.cassandra;
|
||||
package org.springframework.boot.testcontainers.service.connection.cassandra;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.testcontainers.containers.CassandraContainer;
|
||||
|
||||
import org.springframework.boot.autoconfigure.cassandra.CassandraConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionSource;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
|
||||
|
||||
/**
|
||||
* {@link ContainerConnectionDetailsFactory} for
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.cassandra;
|
||||
package org.springframework.boot.testcontainers.service.connection.cassandra;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
@ -23,7 +23,7 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.boot.autoconfigure.cassandra.CassandraConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||
|
||||
/**
|
||||
* Annotation that indicates that a field provides a Cassandra service connection.
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Support for testcontainers Cassandra service connections.
|
||||
*/
|
||||
package org.springframework.boot.testcontainers.service.connection.cassandra;
|
|
@ -14,13 +14,13 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.couchbase;
|
||||
package org.springframework.boot.testcontainers.service.connection.couchbase;
|
||||
|
||||
import org.testcontainers.couchbase.CouchbaseContainer;
|
||||
|
||||
import org.springframework.boot.autoconfigure.couchbase.CouchbaseConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionSource;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
|
||||
|
||||
/**
|
||||
* {@link ContainerConnectionDetailsFactory} for
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.couchbase;
|
||||
package org.springframework.boot.testcontainers.service.connection.couchbase;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
@ -23,7 +23,7 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.boot.autoconfigure.couchbase.CouchbaseConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||
|
||||
/**
|
||||
* Annotation that indicates that a field provides a Couchbase service connection.
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Support for testcontainers Couchbase service connections.
|
||||
*/
|
||||
package org.springframework.boot.testcontainers.service.connection.couchbase;
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.elasticsearch;
|
||||
package org.springframework.boot.testcontainers.service.connection.elasticsearch;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
@ -22,8 +22,8 @@ import org.testcontainers.containers.GenericContainer;
|
|||
|
||||
import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchConnectionDetails;
|
||||
import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchConnectionDetails.Node.Protocol;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionSource;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
|
||||
|
||||
/**
|
||||
* {@link ContainerConnectionDetailsFactory} for
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.elasticsearch;
|
||||
package org.springframework.boot.testcontainers.service.connection.elasticsearch;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
@ -23,7 +23,7 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||
|
||||
/**
|
||||
* Annotation that indicates that a field provides a Elasticsearch service connection.
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Support for testcontainers Elasticsearch service connections.
|
||||
*/
|
||||
package org.springframework.boot.testcontainers.service.connection.elasticsearch;
|
|
@ -14,14 +14,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.flyway;
|
||||
package org.springframework.boot.testcontainers.service.connection.flyway;
|
||||
|
||||
import org.testcontainers.containers.JdbcDatabaseContainer;
|
||||
|
||||
import org.springframework.boot.autoconfigure.flyway.FlywayConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionSource;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||
|
||||
/**
|
||||
* {@link ContainerConnectionDetailsFactory} for
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Support for testcontainers Flyway service connections.
|
||||
*/
|
||||
package org.springframework.boot.testcontainers.service.connection.flyway;
|
|
@ -14,15 +14,15 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.influx;
|
||||
package org.springframework.boot.testcontainers.service.connection.influx;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
import org.testcontainers.containers.InfluxDBContainer;
|
||||
|
||||
import org.springframework.boot.autoconfigure.influx.InfluxDbConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionSource;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
|
||||
|
||||
/**
|
||||
* {@link ContainerConnectionDetailsFactory} for
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.influx;
|
||||
package org.springframework.boot.testcontainers.service.connection.influx;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
@ -23,7 +23,7 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.boot.autoconfigure.influx.InfluxDbConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||
|
||||
/**
|
||||
* Annotation that indicates that a field provides an InfluxDB service connection.
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Support for testcontainers InfluxDB service connections.
|
||||
*/
|
||||
package org.springframework.boot.testcontainers.service.connection.influx;
|
|
@ -14,13 +14,13 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.jdbc;
|
||||
package org.springframework.boot.testcontainers.service.connection.jdbc;
|
||||
|
||||
import org.testcontainers.containers.JdbcDatabaseContainer;
|
||||
|
||||
import org.springframework.boot.autoconfigure.jdbc.JdbcConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionSource;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
|
||||
|
||||
/**
|
||||
* {@link ContainerConnectionDetailsFactory} for
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.jdbc;
|
||||
package org.springframework.boot.testcontainers.service.connection.jdbc;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
@ -23,7 +23,7 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.boot.autoconfigure.jdbc.JdbcConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||
|
||||
/**
|
||||
* Annotation that indicates that a field provides a JDBC database service connection.
|
|
@ -15,6 +15,6 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Auto-configuration for using RabbitMQ in tests.
|
||||
* Support for testcontainers JDBC service connections.
|
||||
*/
|
||||
package org.springframework.boot.test.autoconfigure.amqp;
|
||||
package org.springframework.boot.testcontainers.service.connection.jdbc;
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.kafka;
|
||||
package org.springframework.boot.testcontainers.service.connection.kafka;
|
||||
|
||||
import java.net.URI;
|
||||
import java.util.List;
|
||||
|
@ -22,8 +22,8 @@ import java.util.List;
|
|||
import org.testcontainers.containers.KafkaContainer;
|
||||
|
||||
import org.springframework.boot.autoconfigure.kafka.KafkaConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionSource;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
|
||||
|
||||
/**
|
||||
* {@link ContainerConnectionDetailsFactory} for
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.kafka;
|
||||
package org.springframework.boot.testcontainers.service.connection.kafka;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
@ -23,7 +23,7 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.boot.autoconfigure.kafka.KafkaConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||
|
||||
/**
|
||||
* Annotation that indicates that a field provides a Kafka service connection.
|
|
@ -15,6 +15,6 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Auto-configuration for using Cassandra in tests.
|
||||
* Support for testcontainers Kafka service connections.
|
||||
*/
|
||||
package org.springframework.boot.test.autoconfigure.cassandra;
|
||||
package org.springframework.boot.testcontainers.service.connection.kafka;
|
|
@ -14,14 +14,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.liquibase;
|
||||
package org.springframework.boot.testcontainers.service.connection.liquibase;
|
||||
|
||||
import org.testcontainers.containers.JdbcDatabaseContainer;
|
||||
|
||||
import org.springframework.boot.autoconfigure.liquibase.LiquibaseConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionSource;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||
|
||||
/**
|
||||
* {@link ContainerConnectionDetailsFactory} for
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Support for testcontainers Liquibase service connections.
|
||||
*/
|
||||
package org.springframework.boot.testcontainers.service.connection.liquibase;
|
|
@ -14,14 +14,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.mongo;
|
||||
package org.springframework.boot.testcontainers.service.connection.mongo;
|
||||
|
||||
import com.mongodb.ConnectionString;
|
||||
import org.testcontainers.containers.MongoDBContainer;
|
||||
|
||||
import org.springframework.boot.autoconfigure.mongo.MongoConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionSource;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
|
||||
|
||||
/**
|
||||
* {@link ContainerConnectionDetailsFactory} for
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.mongo;
|
||||
package org.springframework.boot.testcontainers.service.connection.mongo;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
@ -23,7 +23,7 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.boot.autoconfigure.mongo.MongoConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||
|
||||
/**
|
||||
* Annotation that indicates that a field provides a Mongo service connection.
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Support for testcontainers MongoDB service connections.
|
||||
*/
|
||||
package org.springframework.boot.testcontainers.service.connection.mongo;
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.neo4j;
|
||||
package org.springframework.boot.testcontainers.service.connection.neo4j;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
|
@ -23,8 +23,8 @@ import org.neo4j.driver.AuthTokens;
|
|||
import org.testcontainers.containers.Neo4jContainer;
|
||||
|
||||
import org.springframework.boot.autoconfigure.neo4j.Neo4jConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionSource;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
|
||||
|
||||
/**
|
||||
* {@link ContainerConnectionDetailsFactory} for
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.neo4j;
|
||||
package org.springframework.boot.testcontainers.service.connection.neo4j;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
@ -23,7 +23,7 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.boot.autoconfigure.neo4j.Neo4jConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||
|
||||
/**
|
||||
* Annotation that indicates a field provides a Neo4j service connection.
|
|
@ -15,6 +15,6 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Auto-configuration for using Couchbase in tests.
|
||||
* Support for testcontainers Neo4J service connections.
|
||||
*/
|
||||
package org.springframework.boot.test.autoconfigure.couchbase;
|
||||
package org.springframework.boot.testcontainers.service.connection.neo4j;
|
|
@ -17,4 +17,4 @@
|
|||
/**
|
||||
* General support for auto-configuration of service connections in tests.
|
||||
*/
|
||||
package org.springframework.boot.test.autoconfigure.service.connection;
|
||||
package org.springframework.boot.testcontainers.service.connection;
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.r2dbc;
|
||||
package org.springframework.boot.testcontainers.service.connection.r2dbc;
|
||||
|
||||
import io.r2dbc.spi.ConnectionFactoryOptions;
|
||||
import org.testcontainers.containers.MariaDBContainer;
|
||||
|
@ -22,8 +22,8 @@ import org.testcontainers.containers.MariaDBR2DBCDatabaseContainer;
|
|||
|
||||
import org.springframework.boot.autoconfigure.r2dbc.R2dbcConnectionDetails;
|
||||
import org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionSource;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
|
||||
|
||||
/**
|
||||
* {@link ConnectionDetailsFactory} for
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.r2dbc;
|
||||
package org.springframework.boot.testcontainers.service.connection.r2dbc;
|
||||
|
||||
import io.r2dbc.spi.ConnectionFactoryOptions;
|
||||
import org.testcontainers.containers.MySQLContainer;
|
||||
|
@ -22,8 +22,8 @@ import org.testcontainers.containers.MySQLR2DBCDatabaseContainer;
|
|||
|
||||
import org.springframework.boot.autoconfigure.r2dbc.R2dbcConnectionDetails;
|
||||
import org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionSource;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
|
||||
|
||||
/**
|
||||
* {@link ConnectionDetailsFactory} for
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.r2dbc;
|
||||
package org.springframework.boot.testcontainers.service.connection.r2dbc;
|
||||
|
||||
import io.r2dbc.spi.ConnectionFactoryOptions;
|
||||
import org.testcontainers.containers.PostgreSQLContainer;
|
||||
|
@ -22,8 +22,8 @@ import org.testcontainers.containers.PostgreSQLR2DBCDatabaseContainer;
|
|||
|
||||
import org.springframework.boot.autoconfigure.r2dbc.R2dbcConnectionDetails;
|
||||
import org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionSource;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
|
||||
|
||||
/**
|
||||
* {@link ConnectionDetailsFactory} for {@link R2dbcServiceConnection @R2dbcConnection}
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.r2dbc;
|
||||
package org.springframework.boot.testcontainers.service.connection.r2dbc;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
@ -23,7 +23,7 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.boot.autoconfigure.r2dbc.R2dbcConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||
|
||||
/**
|
||||
* Annotation that indicates a field provides a R2DBC database service connection.
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.r2dbc;
|
||||
package org.springframework.boot.testcontainers.service.connection.r2dbc;
|
||||
|
||||
import io.r2dbc.spi.ConnectionFactoryOptions;
|
||||
import org.testcontainers.containers.MSSQLR2DBCDatabaseContainer;
|
||||
|
@ -22,8 +22,8 @@ import org.testcontainers.containers.MSSQLServerContainer;
|
|||
|
||||
import org.springframework.boot.autoconfigure.r2dbc.R2dbcConnectionDetails;
|
||||
import org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionSource;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
|
||||
|
||||
/**
|
||||
* {@link ConnectionDetailsFactory} for
|
|
@ -15,6 +15,6 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Auto-configuration for using Elasticsearch in tests.
|
||||
* Support for testcontainers R2DBC service connections.
|
||||
*/
|
||||
package org.springframework.boot.test.autoconfigure.elasticsearch;
|
||||
package org.springframework.boot.testcontainers.service.connection.r2dbc;
|
|
@ -14,13 +14,13 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.data.redis;
|
||||
package org.springframework.boot.testcontainers.service.connection.redis;
|
||||
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
|
||||
import org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ContainerConnectionSource;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionDetailsFactory;
|
||||
import org.springframework.boot.testcontainers.service.connection.ContainerConnectionSource;
|
||||
|
||||
/**
|
||||
* {@link ContainerConnectionDetailsFactory} for
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.data.redis;
|
||||
package org.springframework.boot.testcontainers.service.connection.redis;
|
||||
|
||||
import java.lang.annotation.Documented;
|
||||
import java.lang.annotation.ElementType;
|
||||
|
@ -23,7 +23,7 @@ import java.lang.annotation.RetentionPolicy;
|
|||
import java.lang.annotation.Target;
|
||||
|
||||
import org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||
|
||||
/**
|
||||
* Annotation that indicates that a field provides a Redis service connection.
|
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright 2012-2023 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Support for testcontainers Redis service connections.
|
||||
*/
|
||||
package org.springframework.boot.testcontainers.service.connection.redis;
|
|
@ -0,0 +1,22 @@
|
|||
# Spring Test ContextCustomizerFactories
|
||||
org.springframework.test.context.ContextCustomizerFactory=\
|
||||
org.springframework.boot.testcontainers.service.connection.ServiceConnectionContextCustomizerFactory
|
||||
|
||||
# Connection Details Factories
|
||||
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
|
||||
org.springframework.boot.testcontainers.service.connection.amqp.RabbitContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.cassandra.CassandraContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.couchbase.CouchbaseContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.flyway.FlywayContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.redis.RedisContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.elasticsearch.ElasticsearchContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.influx.InfluxDbContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.jdbc.JdbcContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.kafka.KafkaContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.liquibase.LiquibaseContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.mongo.MongoContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.neo4j.Neo4jContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.r2dbc.MariaDbR2dbcContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.r2dbc.MySqlR2dbcContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.r2dbc.PostgresR2dbcContainerConnectionDetailsFactory,\
|
||||
org.springframework.boot.testcontainers.service.connection.r2dbc.SqlServerR2dbcContainerConnectionDetailsFactory
|
|
@ -14,14 +14,14 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.service.connection;
|
||||
package org.springframework.boot.testcontainers.service.connection;
|
||||
|
||||
import org.junit.jupiter.api.Nested;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
|
||||
import org.springframework.boot.autoconfigure.service.connection.ConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ServiceConnectionContextCustomizerFactoryTests.ServiceConnections.NestedClass;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnectionContextCustomizerFactoryTests.ServiceConnections.NestedClass;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.amqp;
|
||||
package org.springframework.boot.testcontainers.service.connection.amqp;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.ArrayList;
|
||||
|
@ -25,6 +25,7 @@ import org.junit.jupiter.api.Test;
|
|||
import org.testcontainers.containers.RabbitMQContainer;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import org.testcontainers.utility.DockerImageName;
|
||||
|
||||
import org.springframework.amqp.rabbit.annotation.Queue;
|
||||
import org.springframework.amqp.rabbit.annotation.RabbitListener;
|
||||
|
@ -32,10 +33,10 @@ import org.springframework.amqp.rabbit.core.RabbitTemplate;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.amqp.RabbitAutoConfiguration;
|
||||
import org.springframework.boot.test.autoconfigure.amqp.RabbitServiceConnectionTests.TestConfiguration;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
import org.springframework.boot.autoconfigure.amqp.RabbitConnectionDetails;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
@ -46,27 +47,33 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
* @author Andy Wilkinson
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
@SpringBootTest(classes = TestConfiguration.class)
|
||||
@SpringJUnitConfig
|
||||
@Testcontainers(disabledWithoutDocker = true)
|
||||
class RabbitServiceConnectionTests {
|
||||
|
||||
@Container
|
||||
@RabbitServiceConnection
|
||||
static final RabbitMQContainer rabbit = new RabbitMQContainer(DockerImageNames.rabbit());
|
||||
static final RabbitMQContainer rabbit = new RabbitMQContainer(DockerImageName.parse("rabbitmq:3.11-alpine"));
|
||||
|
||||
@Autowired(required = false)
|
||||
private RabbitConnectionDetails connectionDetails;
|
||||
|
||||
@Autowired
|
||||
RabbitTemplate rabbitTemplate;
|
||||
private RabbitTemplate rabbitTemplate;
|
||||
|
||||
@Autowired
|
||||
TestListener listener;
|
||||
private TestListener listener;
|
||||
|
||||
@Test
|
||||
void connectionCanBeMadeToKafkaContainer() {
|
||||
void connectionCanBeMadeToRabbitContainer() {
|
||||
assertThat(this.connectionDetails).isNotNull();
|
||||
this.rabbitTemplate.convertAndSend("test", "message");
|
||||
Awaitility.waitAtMost(Duration.ofSeconds(30))
|
||||
Awaitility.waitAtMost(Duration.ofMinutes(4))
|
||||
.untilAsserted(() -> assertThat(this.listener.messages).containsExactly("message"));
|
||||
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ImportAutoConfiguration(RabbitAutoConfiguration.class)
|
||||
static class TestConfiguration {
|
||||
|
|
@ -14,20 +14,20 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.influx;
|
||||
package org.springframework.boot.testcontainers.service.connection.influx;
|
||||
|
||||
import org.influxdb.InfluxDB;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.testcontainers.containers.InfluxDBContainer;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import org.testcontainers.utility.DockerImageName;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.influx.InfluxDbAutoConfiguration;
|
||||
import org.springframework.boot.test.autoconfigure.influx.InfluxDbServiceConnectionTests.TestConfiguration;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
@ -38,22 +38,26 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
* @author Andy Wilkinson
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
@SpringBootTest(classes = TestConfiguration.class)
|
||||
@SpringJUnitConfig
|
||||
@Testcontainers(disabledWithoutDocker = true)
|
||||
class InfluxDbServiceConnectionTests {
|
||||
|
||||
private static final String INFLUXDB_VERSION = "2.6.1";
|
||||
|
||||
@Container
|
||||
@InfluxDbServiceConnection
|
||||
static final InfluxDBContainer<?> influxDbService = new InfluxDBContainer<>(DockerImageNames.influxDb());
|
||||
static final InfluxDBContainer<?> influxDbService = new InfluxDBContainer<>(
|
||||
DockerImageName.parse("influxdb").withTag(INFLUXDB_VERSION));
|
||||
|
||||
@Autowired
|
||||
InfluxDB influxDb;
|
||||
private InfluxDB influxDb;
|
||||
|
||||
@Test
|
||||
void connectionCanBeMadeToInfluxDbContainer() {
|
||||
assertThat(this.influxDb.version()).isEqualTo("v" + DockerImageNames.influxDb().getVersionPart());
|
||||
assertThat(this.influxDb.version()).isEqualTo("v" + INFLUXDB_VERSION);
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ImportAutoConfiguration(InfluxDbAutoConfiguration.class)
|
||||
static class TestConfiguration {
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.test.autoconfigure.kafka;
|
||||
package org.springframework.boot.testcontainers.service.connection.kafka;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.ArrayList;
|
||||
|
@ -25,16 +25,17 @@ import org.junit.jupiter.api.Test;
|
|||
import org.testcontainers.containers.KafkaContainer;
|
||||
import org.testcontainers.junit.jupiter.Container;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
import org.testcontainers.utility.DockerImageName;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.ImportAutoConfiguration;
|
||||
import org.springframework.boot.autoconfigure.kafka.KafkaAutoConfiguration;
|
||||
import org.springframework.boot.test.autoconfigure.kafka.KafkaServiceConnectionTests.TestConfiguration;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.kafka.annotation.KafkaListener;
|
||||
import org.springframework.kafka.core.KafkaTemplate;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
import org.springframework.test.context.junit.jupiter.SpringJUnitConfig;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
|
@ -45,29 +46,30 @@ import static org.assertj.core.api.Assertions.assertThat;
|
|||
* @author Andy Wilkinson
|
||||
* @author Phillip Webb
|
||||
*/
|
||||
@SpringBootTest(classes = TestConfiguration.class,
|
||||
properties = { "spring.kafka.consumer.group-id=test-group",
|
||||
"spring.kafka.consumer.auto-offset-reset=earliest" })
|
||||
@SpringJUnitConfig
|
||||
@Testcontainers(disabledWithoutDocker = true)
|
||||
@TestPropertySource(properties = { "spring.kafka.consumer.group-id=test-group",
|
||||
"spring.kafka.consumer.auto-offset-reset=earliest" })
|
||||
class KafkaServiceConnectionTests {
|
||||
|
||||
@Container
|
||||
@KafkaServiceConnection
|
||||
static final KafkaContainer kafka = new KafkaContainer(DockerImageNames.kafka());
|
||||
static final KafkaContainer kafka = new KafkaContainer(DockerImageName.parse("confluentinc/cp-kafka:5.4.3"));
|
||||
|
||||
@Autowired
|
||||
KafkaTemplate<String, String> kafkaTemplate;
|
||||
private KafkaTemplate<String, String> kafkaTemplate;
|
||||
|
||||
@Autowired
|
||||
TestListener listener;
|
||||
private TestListener listener;
|
||||
|
||||
@Test
|
||||
void connectionCanBeMadeToKafkaContainer() {
|
||||
this.kafkaTemplate.send("test-topic", "test-data");
|
||||
Awaitility.waitAtMost(Duration.ofSeconds(30))
|
||||
Awaitility.waitAtMost(Duration.ofMinutes(4))
|
||||
.untilAsserted(() -> assertThat(this.listener.messages).containsExactly("test-data"));
|
||||
}
|
||||
|
||||
@Configuration(proxyBeanMethods = false)
|
||||
@ImportAutoConfiguration(KafkaAutoConfiguration.class)
|
||||
static class TestConfiguration {
|
||||
|
|
@ -0,0 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<include resource="org/springframework/boot/logging/logback/base.xml"/>
|
||||
</configuration>
|
|
@ -59,6 +59,7 @@ dependencies {
|
|||
redisTestImplementation(enforcedPlatform(project(":spring-boot-project:spring-boot-parent")))
|
||||
redisTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-data-redis"))
|
||||
redisTestImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
|
||||
redisTestImplementation(project(":spring-boot-project:spring-boot-testcontainers"))
|
||||
redisTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||
redisTestImplementation("org.testcontainers:testcontainers")
|
||||
redisTestImplementation("org.testcontainers:junit-jupiter")
|
||||
|
|
|
@ -21,8 +21,8 @@ import org.testcontainers.junit.jupiter.Container;
|
|||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.data.redis.RedisServiceConnection;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.testcontainers.service.connection.redis.RedisServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.RedisContainer;
|
||||
import org.springframework.cache.Cache;
|
||||
import org.springframework.cache.CacheManager;
|
||||
|
|
|
@ -14,6 +14,7 @@ dependencies {
|
|||
runtimeOnly("org.springframework:spring-jdbc")
|
||||
|
||||
testImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-testcontainers"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||
testImplementation("io.projectreactor:reactor-test")
|
||||
testImplementation("org.testcontainers:junit-jupiter")
|
||||
|
|
|
@ -25,8 +25,8 @@ import reactor.test.StepVerifier;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.flyway.FlywayConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.data.r2dbc.DataR2dbcTest;
|
||||
import org.springframework.boot.test.autoconfigure.r2dbc.R2dbcServiceConnection;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.r2dbc.R2dbcServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
|
|
@ -17,6 +17,7 @@ dependencies {
|
|||
runtimeOnly("org.springframework:spring-jdbc")
|
||||
|
||||
testImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-testcontainers"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||
testImplementation("io.projectreactor:reactor-test")
|
||||
testImplementation("org.testcontainers:junit-jupiter")
|
||||
|
|
|
@ -25,8 +25,8 @@ import reactor.test.StepVerifier;
|
|||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.autoconfigure.liquibase.LiquibaseConnectionDetails;
|
||||
import org.springframework.boot.test.autoconfigure.data.r2dbc.DataR2dbcTest;
|
||||
import org.springframework.boot.test.autoconfigure.r2dbc.R2dbcServiceConnection;
|
||||
import org.springframework.boot.test.autoconfigure.service.connection.ServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.ServiceConnection;
|
||||
import org.springframework.boot.testcontainers.service.connection.r2dbc.R2dbcServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
|
|
@ -15,6 +15,7 @@ dependencies {
|
|||
testImplementation("org.testcontainers:mongodb")
|
||||
testImplementation("org.testcontainers:testcontainers")
|
||||
testImplementation("org.testcontainers:junit-jupiter")
|
||||
testImplementation(project(":spring-boot-project:spring-boot-testcontainers"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
|
||||
}
|
||||
|
|
|
@ -28,10 +28,10 @@ import org.testcontainers.junit.jupiter.Container;
|
|||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.mongo.MongoServiceConnection;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
||||
import org.springframework.boot.test.web.server.LocalServerPort;
|
||||
import org.springframework.boot.testcontainers.service.connection.mongo.MongoServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.DockerImageNames;
|
||||
import org.springframework.core.ParameterizedTypeReference;
|
||||
import org.springframework.http.HttpEntity;
|
||||
|
|
|
@ -14,6 +14,7 @@ dependencies {
|
|||
|
||||
testImplementation("org.testcontainers:testcontainers")
|
||||
testImplementation("org.testcontainers:junit-jupiter")
|
||||
testImplementation(project(":spring-boot-project:spring-boot-testcontainers"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
|
||||
}
|
||||
|
|
|
@ -26,9 +26,9 @@ import org.testcontainers.junit.jupiter.Container;
|
|||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.data.redis.RedisServiceConnection;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
||||
import org.springframework.boot.testcontainers.service.connection.redis.RedisServiceConnection;
|
||||
import org.springframework.boot.testsupport.testcontainers.RedisContainer;
|
||||
import org.springframework.core.ParameterizedTypeReference;
|
||||
import org.springframework.http.HttpEntity;
|
||||
|
|
|
@ -13,8 +13,8 @@ dependencies {
|
|||
runtimeOnly("org.springframework.session:spring-session-data-mongodb")
|
||||
|
||||
testImplementation(project(":spring-boot-project:spring-boot-starters:spring-boot-starter-test"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-testcontainers"))
|
||||
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
|
||||
testImplementation("org.testcontainers:mongodb")
|
||||
testImplementation("org.testcontainers:testcontainers")
|
||||
testImplementation("org.testcontainers:junit-jupiter")
|
||||
}
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user