24 changed files with 126 additions and 526 deletions
@ -1,47 +0,0 @@
@@ -1,47 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2024 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. |
||||
*/ |
||||
|
||||
package org.springframework.boot.docker.compose.service.connection.cassandra; |
||||
|
||||
import java.util.List; |
||||
|
||||
import org.springframework.boot.autoconfigure.cassandra.CassandraConnectionDetails; |
||||
import org.springframework.boot.autoconfigure.cassandra.CassandraConnectionDetails.Node; |
||||
import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest; |
||||
import org.springframework.boot.testsupport.container.TestImage; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Integration test for {@link CassandraDockerComposeConnectionDetailsFactory}. |
||||
* |
||||
* @author Scott Frederick |
||||
*/ |
||||
class CassandraBitnamiDockerComposeConnectionDetailsFactoryIntegrationTests { |
||||
|
||||
@DockerComposeTest(composeFile = "cassandra-bitnami-compose.yaml", image = TestImage.BITNAMI_CASSANDRA) |
||||
void runCreatesConnectionDetails(CassandraConnectionDetails connectionDetails) { |
||||
List<Node> contactPoints = connectionDetails.getContactPoints(); |
||||
assertThat(contactPoints).hasSize(1); |
||||
Node node = contactPoints.get(0); |
||||
assertThat(node.host()).isNotNull(); |
||||
assertThat(node.port()).isGreaterThan(0); |
||||
assertThat(connectionDetails.getUsername()).isNull(); |
||||
assertThat(connectionDetails.getPassword()).isNull(); |
||||
assertThat(connectionDetails.getLocalDatacenter()).isEqualTo("testdc1"); |
||||
} |
||||
|
||||
} |
||||
@ -1,48 +0,0 @@
@@ -1,48 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2024 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. |
||||
*/ |
||||
|
||||
package org.springframework.boot.docker.compose.service.connection.elasticsearch; |
||||
|
||||
import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchConnectionDetails; |
||||
import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchConnectionDetails.Node; |
||||
import org.springframework.boot.autoconfigure.elasticsearch.ElasticsearchConnectionDetails.Node.Protocol; |
||||
import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest; |
||||
import org.springframework.boot.testsupport.container.TestImage; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Integration tests for {@link ElasticsearchDockerComposeConnectionDetailsFactory}. |
||||
* |
||||
* @author Scott Frederick |
||||
*/ |
||||
class ElasticsearchBitnamiDockerComposeConnectionDetailsFactoryIntegrationTests { |
||||
|
||||
@DockerComposeTest(composeFile = "elasticsearch-bitnami-compose.yaml", image = TestImage.BITNAMI_ELASTICSEARCH) |
||||
void runCreatesConnectionDetails(ElasticsearchConnectionDetails connectionDetails) { |
||||
assertThat(connectionDetails.getUsername()).isEqualTo("elastic"); |
||||
assertThat(connectionDetails.getPassword()).isEqualTo("secret"); |
||||
assertThat(connectionDetails.getPathPrefix()).isNull(); |
||||
assertThat(connectionDetails.getNodes()).hasSize(1); |
||||
Node node = connectionDetails.getNodes().get(0); |
||||
assertThat(node.hostname()).isNotNull(); |
||||
assertThat(node.port()).isGreaterThan(0); |
||||
assertThat(node.protocol()).isEqualTo(Protocol.HTTP); |
||||
assertThat(node.username()).isEqualTo("elastic"); |
||||
assertThat(node.password()).isEqualTo("secret"); |
||||
} |
||||
|
||||
} |
||||
@ -1,39 +0,0 @@
@@ -1,39 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2024 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. |
||||
*/ |
||||
|
||||
package org.springframework.boot.docker.compose.service.connection.mariadb; |
||||
|
||||
import org.springframework.boot.autoconfigure.jdbc.JdbcConnectionDetails; |
||||
import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest; |
||||
import org.springframework.boot.testsupport.container.TestImage; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Integration tests for {@link MariaDbJdbcDockerComposeConnectionDetailsFactory}. |
||||
* |
||||
* @author Scott Frederick |
||||
*/ |
||||
class MariaDbBitnamiJdbcDockerComposeConnectionDetailsFactoryIntegrationTests { |
||||
|
||||
@DockerComposeTest(composeFile = "mariadb-bitnami-compose.yaml", image = TestImage.BITNAMI_MARIADB) |
||||
void runCreatesConnectionDetails(JdbcConnectionDetails connectionDetails) { |
||||
assertThat(connectionDetails.getUsername()).isEqualTo("myuser"); |
||||
assertThat(connectionDetails.getPassword()).isEqualTo("secret"); |
||||
assertThat(connectionDetails.getJdbcUrl()).startsWith("jdbc:mariadb://").endsWith("/mydatabase"); |
||||
} |
||||
|
||||
} |
||||
@ -1,42 +0,0 @@
@@ -1,42 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2024 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. |
||||
*/ |
||||
|
||||
package org.springframework.boot.docker.compose.service.connection.mariadb; |
||||
|
||||
import io.r2dbc.spi.ConnectionFactoryOptions; |
||||
|
||||
import org.springframework.boot.autoconfigure.r2dbc.R2dbcConnectionDetails; |
||||
import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest; |
||||
import org.springframework.boot.testsupport.container.TestImage; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Integration tests for {@link MariaDbR2dbcDockerComposeConnectionDetailsFactory}. |
||||
* |
||||
* @author Scott Frederick |
||||
*/ |
||||
class MariaDbBitnamiR2dbcDockerComposeConnectionDetailsFactoryIntegrationTests { |
||||
|
||||
@DockerComposeTest(composeFile = "mariadb-bitnami-compose.yaml", image = TestImage.BITNAMI_MARIADB) |
||||
void runCreatesConnectionDetails(R2dbcConnectionDetails connectionDetails) { |
||||
ConnectionFactoryOptions connectionFactoryOptions = connectionDetails.getConnectionFactoryOptions(); |
||||
assertThat(connectionFactoryOptions.toString()).contains("database=mydatabase", "driver=mariadb", |
||||
"password=REDACTED", "user=myuser"); |
||||
assertThat(connectionFactoryOptions.getRequiredValue(ConnectionFactoryOptions.PASSWORD)).isEqualTo("secret"); |
||||
} |
||||
|
||||
} |
||||
@ -1,47 +0,0 @@
@@ -1,47 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2024 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. |
||||
*/ |
||||
|
||||
package org.springframework.boot.docker.compose.service.connection.mongo; |
||||
|
||||
import com.mongodb.ConnectionString; |
||||
import org.junit.jupiter.api.condition.OS; |
||||
|
||||
import org.springframework.boot.autoconfigure.mongo.MongoConnectionDetails; |
||||
import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest; |
||||
import org.springframework.boot.testsupport.container.TestImage; |
||||
import org.springframework.boot.testsupport.junit.DisabledOnOs; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Integration tests for {@link MongoDockerComposeConnectionDetailsFactory}. |
||||
* |
||||
* @author Scott Frederick |
||||
*/ |
||||
@DisabledOnOs(os = { OS.LINUX, OS.MAC }, architecture = "aarch64", disabledReason = "The image has no ARM support") |
||||
class MongoBitnamiDockerComposeConnectionDetailsFactoryIntegrationTests { |
||||
|
||||
@DockerComposeTest(composeFile = "mongo-bitnami-compose.yaml", image = TestImage.BITNAMI_MONGODB) |
||||
void runCreatesConnectionDetails(MongoConnectionDetails connectionDetails) { |
||||
ConnectionString connectionString = connectionDetails.getConnectionString(); |
||||
assertThat(connectionString.getCredential().getUserName()).isEqualTo("root"); |
||||
assertThat(connectionString.getCredential().getPassword()).isEqualTo("secret".toCharArray()); |
||||
assertThat(connectionString.getCredential().getSource()).isEqualTo("admin"); |
||||
assertThat(connectionString.getDatabase()).isEqualTo("testdb"); |
||||
assertThat(connectionDetails.getGridFs()).isNull(); |
||||
} |
||||
|
||||
} |
||||
@ -1,39 +0,0 @@
@@ -1,39 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2024 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. |
||||
*/ |
||||
|
||||
package org.springframework.boot.docker.compose.service.connection.mysql; |
||||
|
||||
import org.springframework.boot.autoconfigure.jdbc.JdbcConnectionDetails; |
||||
import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest; |
||||
import org.springframework.boot.testsupport.container.TestImage; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Integration tests for {@link MySqlJdbcDockerComposeConnectionDetailsFactory}. |
||||
* |
||||
* @author Scott Frederick |
||||
*/ |
||||
class MySqlBitnamiJdbcDockerComposeConnectionDetailsFactoryIntegrationTests { |
||||
|
||||
@DockerComposeTest(composeFile = "mysql-bitnami-compose.yaml", image = TestImage.BITNAMI_MYSQL) |
||||
void runCreatesConnectionDetails(JdbcConnectionDetails connectionDetails) { |
||||
assertThat(connectionDetails.getUsername()).isEqualTo("myuser"); |
||||
assertThat(connectionDetails.getPassword()).isEqualTo("secret"); |
||||
assertThat(connectionDetails.getJdbcUrl()).startsWith("jdbc:mysql://").endsWith("/mydatabase"); |
||||
} |
||||
|
||||
} |
||||
@ -1,42 +0,0 @@
@@ -1,42 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2024 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. |
||||
*/ |
||||
|
||||
package org.springframework.boot.docker.compose.service.connection.mysql; |
||||
|
||||
import io.r2dbc.spi.ConnectionFactoryOptions; |
||||
|
||||
import org.springframework.boot.autoconfigure.r2dbc.R2dbcConnectionDetails; |
||||
import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest; |
||||
import org.springframework.boot.testsupport.container.TestImage; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Integration tests for {@link MySqlR2dbcDockerComposeConnectionDetailsFactory}. |
||||
* |
||||
* @author Scott Frederick |
||||
*/ |
||||
class MySqlBitnamiR2dbcDockerComposeConnectionDetailsFactoryIntegrationTests { |
||||
|
||||
@DockerComposeTest(composeFile = "mysql-bitnami-compose.yaml", image = TestImage.BITNAMI_MYSQL) |
||||
void runCreatesConnectionDetails(R2dbcConnectionDetails connectionDetails) { |
||||
ConnectionFactoryOptions connectionFactoryOptions = connectionDetails.getConnectionFactoryOptions(); |
||||
assertThat(connectionFactoryOptions.toString()).contains("database=mydatabase", "driver=mysql", |
||||
"password=REDACTED", "user=myuser"); |
||||
assertThat(connectionFactoryOptions.getRequiredValue(ConnectionFactoryOptions.PASSWORD)).isEqualTo("secret"); |
||||
} |
||||
|
||||
} |
||||
@ -1,45 +0,0 @@
@@ -1,45 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2024 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. |
||||
*/ |
||||
|
||||
package org.springframework.boot.docker.compose.service.connection.neo4j; |
||||
|
||||
import org.neo4j.driver.AuthTokens; |
||||
import org.neo4j.driver.Driver; |
||||
import org.neo4j.driver.GraphDatabase; |
||||
|
||||
import org.springframework.boot.autoconfigure.neo4j.Neo4jConnectionDetails; |
||||
import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest; |
||||
import org.springframework.boot.testsupport.container.TestImage; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
import static org.assertj.core.api.Assertions.assertThatNoException; |
||||
|
||||
/** |
||||
* Integration tests for {@link Neo4jDockerComposeConnectionDetailsFactory}. |
||||
* |
||||
* @author Scott Frederick |
||||
*/ |
||||
class Neo4jBitnamiDockerComposeConnectionDetailsFactoryIntegrationTests { |
||||
|
||||
@DockerComposeTest(composeFile = "neo4j-bitnami-compose.yaml", image = TestImage.BITNAMI_NEO4J) |
||||
void runCreatesConnectionDetailsThatCanAccessNeo4j(Neo4jConnectionDetails connectionDetails) { |
||||
assertThat(connectionDetails.getAuthToken()).isEqualTo(AuthTokens.basic("neo4j", "bitnami2")); |
||||
try (Driver driver = GraphDatabase.driver(connectionDetails.getUri(), connectionDetails.getAuthToken())) { |
||||
assertThatNoException().isThrownBy(driver::verifyConnectivity); |
||||
} |
||||
} |
||||
|
||||
} |
||||
@ -1,42 +0,0 @@
@@ -1,42 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2024 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. |
||||
*/ |
||||
|
||||
package org.springframework.boot.docker.compose.service.connection.postgres; |
||||
|
||||
import org.junit.jupiter.api.Test; |
||||
|
||||
import org.springframework.boot.autoconfigure.jdbc.JdbcConnectionDetails; |
||||
import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest; |
||||
import org.springframework.boot.testsupport.container.TestImage; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Integration tests for {@link PostgresJdbcDockerComposeConnectionDetailsFactory}. |
||||
* |
||||
* @author Scott Frederick |
||||
*/ |
||||
class PostgresBitnamiJdbcDockerComposeConnectionDetailsFactoryIntegrationTests { |
||||
|
||||
@Test |
||||
@DockerComposeTest(composeFile = "postgres-bitnami-compose.yaml", image = TestImage.BITNAMI_POSTGRESQL) |
||||
void runCreatesConnectionDetails(JdbcConnectionDetails connectionDetails) { |
||||
assertThat(connectionDetails.getUsername()).isEqualTo("myuser"); |
||||
assertThat(connectionDetails.getPassword()).isEqualTo("secret"); |
||||
assertThat(connectionDetails.getJdbcUrl()).startsWith("jdbc:postgresql://").endsWith("/mydatabase"); |
||||
} |
||||
|
||||
} |
||||
@ -1,42 +0,0 @@
@@ -1,42 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2024 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. |
||||
*/ |
||||
|
||||
package org.springframework.boot.docker.compose.service.connection.postgres; |
||||
|
||||
import io.r2dbc.spi.ConnectionFactoryOptions; |
||||
|
||||
import org.springframework.boot.autoconfigure.r2dbc.R2dbcConnectionDetails; |
||||
import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest; |
||||
import org.springframework.boot.testsupport.container.TestImage; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Integration tests for {@link PostgresR2dbcDockerComposeConnectionDetailsFactory}. |
||||
* |
||||
* @author Scott Frederick |
||||
*/ |
||||
class PostgresBitnamiR2dbcDockerComposeConnectionDetailsFactoryIntegrationTests { |
||||
|
||||
@DockerComposeTest(composeFile = "postgres-bitnami-compose.yaml", image = TestImage.BITNAMI_POSTGRESQL) |
||||
void runCreatesConnectionDetails(R2dbcConnectionDetails connectionDetails) { |
||||
ConnectionFactoryOptions connectionFactoryOptions = connectionDetails.getConnectionFactoryOptions(); |
||||
assertThat(connectionFactoryOptions.toString()).contains("database=mydatabase", "driver=postgresql", |
||||
"password=REDACTED", "user=myuser"); |
||||
assertThat(connectionFactoryOptions.getRequiredValue(ConnectionFactoryOptions.PASSWORD)).isEqualTo("secret"); |
||||
} |
||||
|
||||
} |
||||
@ -1,44 +0,0 @@
@@ -1,44 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2024 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. |
||||
*/ |
||||
|
||||
package org.springframework.boot.docker.compose.service.connection.rabbit; |
||||
|
||||
import org.springframework.boot.autoconfigure.amqp.RabbitConnectionDetails; |
||||
import org.springframework.boot.autoconfigure.amqp.RabbitConnectionDetails.Address; |
||||
import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest; |
||||
import org.springframework.boot.testsupport.container.TestImage; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Integration tests for {@link RabbitDockerComposeConnectionDetailsFactory}. |
||||
* |
||||
* @author Scott Frederick |
||||
*/ |
||||
class RabbitBitnamiDockerComposeConnectionDetailsFactoryIntegrationTests { |
||||
|
||||
@DockerComposeTest(composeFile = "rabbit-bitnami-compose.yaml", image = TestImage.BITNAMI_RABBITMQ) |
||||
void runCreatesConnectionDetails(RabbitConnectionDetails connectionDetails) { |
||||
assertThat(connectionDetails.getUsername()).isEqualTo("myuser"); |
||||
assertThat(connectionDetails.getPassword()).isEqualTo("secret"); |
||||
assertThat(connectionDetails.getVirtualHost()).isEqualTo("/"); |
||||
assertThat(connectionDetails.getAddresses()).hasSize(1); |
||||
Address address = connectionDetails.getFirstAddress(); |
||||
assertThat(address.host()).isNotNull(); |
||||
assertThat(address.port()).isGreaterThan(0); |
||||
} |
||||
|
||||
} |
||||
@ -1,46 +0,0 @@
@@ -1,46 +0,0 @@
|
||||
/* |
||||
* Copyright 2012-2024 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. |
||||
*/ |
||||
|
||||
package org.springframework.boot.docker.compose.service.connection.redis; |
||||
|
||||
import org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails; |
||||
import org.springframework.boot.autoconfigure.data.redis.RedisConnectionDetails.Standalone; |
||||
import org.springframework.boot.docker.compose.service.connection.test.DockerComposeTest; |
||||
import org.springframework.boot.testsupport.container.TestImage; |
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat; |
||||
|
||||
/** |
||||
* Integration test for {@link RedisDockerComposeConnectionDetailsFactory}. |
||||
* |
||||
* @author Scott Frederick |
||||
*/ |
||||
class RedisBitnamiDockerComposeConnectionDetailsFactoryIntegrationTests { |
||||
|
||||
@DockerComposeTest(composeFile = "redis-bitnami-compose.yaml", image = TestImage.BITNAMI_REDIS) |
||||
void runCreatesConnectionDetails(RedisConnectionDetails connectionDetails) { |
||||
Standalone standalone = connectionDetails.getStandalone(); |
||||
assertThat(connectionDetails.getUsername()).isNull(); |
||||
assertThat(connectionDetails.getPassword()).isNull(); |
||||
assertThat(connectionDetails.getCluster()).isNull(); |
||||
assertThat(connectionDetails.getSentinel()).isNull(); |
||||
assertThat(standalone).isNotNull(); |
||||
assertThat(standalone.getDatabase()).isZero(); |
||||
assertThat(standalone.getPort()).isGreaterThan(0); |
||||
assertThat(standalone.getHost()).isNotNull(); |
||||
} |
||||
|
||||
} |
||||
Loading…
Reference in new issue