Skip to content

Commit f33e858

Browse files
philwebbsnicoll
authored andcommitted
Move MongoDB Docker Compose support into spring-boot-mongodb
1 parent e091928 commit f33e858

File tree

10 files changed

+31
-7
lines changed

10 files changed

+31
-7
lines changed

spring-boot-project/spring-boot-docker-compose-all/src/main/resources/META-INF/spring.factories

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
33
org.springframework.boot.docker.compose.service.connection.clickhouse.ClickHouseR2dbcDockerComposeConnectionDetailsFactory,\
44
org.springframework.boot.docker.compose.service.connection.mariadb.MariaDbR2dbcDockerComposeConnectionDetailsFactory,\
5-
org.springframework.boot.docker.compose.service.connection.mongo.MongoDockerComposeConnectionDetailsFactory,\
65
org.springframework.boot.docker.compose.service.connection.mysql.MySqlR2dbcDockerComposeConnectionDetailsFactory,\
76
org.springframework.boot.docker.compose.service.connection.neo4j.Neo4jDockerComposeConnectionDetailsFactory,\
87
org.springframework.boot.docker.compose.service.connection.oracle.OracleFreeR2dbcDockerComposeConnectionDetailsFactory,\

spring-boot-project/spring-boot-mongodb/build.gradle

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ plugins {
33
id "org.springframework.boot.auto-configuration"
44
id "org.springframework.boot.configuration-properties"
55
id "org.springframework.boot.deployed"
6+
id "org.springframework.boot.docker-test"
67
id "org.springframework.boot.optional-dependencies"
78
}
89

@@ -12,13 +13,18 @@ dependencies {
1213
api(project(":spring-boot-project:spring-boot"))
1314

1415
optional(project(":spring-boot-project:spring-boot-autoconfigure"))
16+
optional(project(":spring-boot-project:spring-boot-docker-compose"))
1517
optional(project(":spring-boot-project:spring-boot-reactor"))
1618
optional(project(":spring-boot-project:spring-boot-testcontainers"))
1719
optional("io.netty:netty-transport")
1820
optional("org.mongodb:mongodb-driver-reactivestreams")
1921
optional("org.mongodb:mongodb-driver-sync")
2022
optional("org.testcontainers:mongodb")
2123

24+
dockerTestImplementation(project(":spring-boot-project:spring-boot-test"))
25+
dockerTestImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support-docker"))
26+
dockerTestImplementation(testFixtures(project(":spring-boot-project:spring-boot-docker-compose")))
27+
2228
testImplementation(project(":spring-boot-project:spring-boot-test"))
2329
testImplementation(project(":spring-boot-project:spring-boot-tools:spring-boot-test-support"))
2430
testImplementation(testFixtures(project(":spring-boot-project:spring-boot-testcontainers")))

spring-boot-project/spring-boot-docker-compose-all/src/dockerTest/java/org/springframework/boot/docker/compose/service/connection/mongo/MongoDockerComposeConnectionDetailsFactoryIntegrationTests.java renamed to spring-boot-project/spring-boot-mongodb/src/dockerTest/java/org/springframework/boot/mongodb/docker/compose/MongoDockerComposeConnectionDetailsFactoryIntegrationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.docker.compose.service.connection.mongo;
17+
package org.springframework.boot.mongodb.docker.compose;
1818

1919
import com.mongodb.ConnectionString;
2020
import org.junit.jupiter.api.condition.OS;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
mongo:
3+
image: '{imageName}'
4+
ports:
5+
- '27017'
6+
environment:
7+
- 'MONGODB_ROOT_USERNAME=root'
8+
- 'MONGODB_ROOT_PASSWORD=secret'
9+
- 'MONGODB_DATABASE=testdb'
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
services:
2+
mongo:
3+
image: '{imageName}'
4+
ports:
5+
- '27017'
6+
environment:
7+
MONGO_INITDB_ROOT_USERNAME: 'root'
8+
MONGO_INITDB_ROOT_PASSWORD: 'secret'
9+
MONGO_INITDB_DATABASE: 'mydatabase'

spring-boot-project/spring-boot-docker-compose-all/src/main/java/org/springframework/boot/docker/compose/service/connection/mongo/MongoDockerComposeConnectionDetailsFactory.java renamed to spring-boot-project/spring-boot-mongodb/src/main/java/org/springframework/boot/mongodb/docker/compose/MongoDockerComposeConnectionDetailsFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.docker.compose.service.connection.mongo;
17+
package org.springframework.boot.mongodb.docker.compose;
1818

1919
import com.mongodb.ConnectionString;
2020

spring-boot-project/spring-boot-docker-compose-all/src/main/java/org/springframework/boot/docker/compose/service/connection/mongo/MongoEnvironment.java renamed to spring-boot-project/spring-boot-mongodb/src/main/java/org/springframework/boot/mongodb/docker/compose/MongoEnvironment.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.docker.compose.service.connection.mongo;
17+
package org.springframework.boot.mongodb.docker.compose;
1818

1919
import java.util.Map;
2020

spring-boot-project/spring-boot-docker-compose-all/src/main/java/org/springframework/boot/docker/compose/service/connection/mongo/package-info.java renamed to spring-boot-project/spring-boot-mongodb/src/main/java/org/springframework/boot/mongodb/docker/compose/package-info.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@
1515
*/
1616

1717
/**
18-
* Auto-configuration for Docker Compose MongoDB service connections.
18+
* Support for Docker Compose MongoDB service connections.
1919
*/
20-
package org.springframework.boot.docker.compose.service.connection.mongo;
20+
package org.springframework.boot.mongodb.docker.compose;
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# Connection Details Factories
22
org.springframework.boot.autoconfigure.service.connection.ConnectionDetailsFactory=\
3+
org.springframework.boot.mongodb.docker.compose.MongoDockerComposeConnectionDetailsFactory,\
34
org.springframework.boot.mongodb.testcontainers.MongoContainerConnectionDetailsFactory

spring-boot-project/spring-boot-docker-compose-all/src/test/java/org/springframework/boot/docker/compose/service/connection/mongo/MongoEnvironmentTests.java renamed to spring-boot-project/spring-boot-mongodb/src/test/java/org/springframework/boot/mongodb/docker/compose/MongoEnvironmentTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.docker.compose.service.connection.mongo;
17+
package org.springframework.boot.mongodb.docker.compose;
1818

1919
import java.util.Collections;
2020
import java.util.Map;

0 commit comments

Comments
 (0)