Files
spring-boot/smoke-test/spring-boot-smoke-test-rabbitmq/src/dockerTest/java/smoketest/rabbitmq/SecureRabbitMqContainer.java
T
Stéphane Nicoll f48cc3ac10 Move Spring AMQP 0.9 support to spring-boot-rabbitmq
Now that Spring AMQP supports AMQP 1.0 as well, we need to straighten
out our existing support. AMQP 0.9 is RabbitMQ specific, so we can no
longer refer it to "amqp". This commit migrates the existing support
to spring-boot-rabbitmq and renames the starters as well.

For continuity, users should migrate from "spring-boot-starter-amqp"
to "spring-boot-starter-rabbitmq". While the root package has been
changed for consistency, most names are the same, including
configuration properties still in the "spring.rabbitmq" namespace.

Keys to configure the version of the RabbitMQ clients have migrated to
'rabbitmq.client' and 'rabbitmq.stream.client' respectively.

Closes gh-49677
2026-07-15 15:10:09 +02:00

46 lines
1.6 KiB
Java

/*
* Copyright 2012-present 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 smoketest.rabbitmq;
import org.testcontainers.rabbitmq.RabbitMQContainer;
import org.testcontainers.utility.DockerImageName;
import org.testcontainers.utility.MountableFile;
/**
* A {@link RabbitMQContainer} for RabbitMQ with SSL configuration.
*
* @author Scott Frederick
*/
class SecureRabbitMqContainer extends RabbitMQContainer {
SecureRabbitMqContainer(DockerImageName dockerImageName) {
super(dockerImageName);
}
@Override
public void configure() {
withCopyFileToContainer(MountableFile.forClasspathResource("/ssl/rabbitmq.conf"),
"/etc/rabbitmq/rabbitmq.conf");
withCopyFileToContainer(MountableFile.forClasspathResource("/ssl/test-server.crt"),
"/etc/rabbitmq/server_cert.pem");
withCopyFileToContainer(MountableFile.forClasspathResource("/ssl/test-server.key"),
"/etc/rabbitmq/server_key.pem");
withCopyFileToContainer(MountableFile.forClasspathResource("/ssl/test-ca.crt"), "/etc/rabbitmq/ca_cert.pem");
}
}