Polish "Move xmpp testcontainer to function-test-support"
- Removed custom container - Removed extra whitespace - Moved static props to SBT.properties
This commit is contained in:
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* Copyright 2014-2022 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.cloud.fn.test.support.xmpp;
|
||||
|
||||
import org.testcontainers.containers.BindMode;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.containers.wait.strategy.Wait;
|
||||
import org.testcontainers.utility.DockerImageName;
|
||||
|
||||
/**
|
||||
* @author Chris Bono
|
||||
*/
|
||||
public class XmppContainer extends GenericContainer<XmppContainer> {
|
||||
|
||||
private static final DockerImageName DEFAULT_IMAGE_NAME = DockerImageName.parse("fishbowler/openfire:v4.7.0");
|
||||
|
||||
private static final int XMPP_INTERNAL_PORT = 5222;
|
||||
|
||||
public XmppContainer() {
|
||||
this(DEFAULT_IMAGE_NAME);
|
||||
}
|
||||
|
||||
public XmppContainer(DockerImageName dockerImageName) {
|
||||
super(dockerImageName);
|
||||
dockerImageName.assertCompatibleWith(DEFAULT_IMAGE_NAME);
|
||||
withExposedPorts(XMPP_INTERNAL_PORT);
|
||||
withClasspathResourceMapping("xmpp/conf", "/var/lib/openfire/conf", BindMode.READ_ONLY);
|
||||
withCommand("-demoboot");
|
||||
setWaitStrategy(Wait.defaultWaitStrategy());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -17,6 +17,8 @@
|
||||
package org.springframework.cloud.fn.test.support.xmpp;
|
||||
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.testcontainers.containers.BindMode;
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
import org.testcontainers.junit.jupiter.Testcontainers;
|
||||
|
||||
/**
|
||||
@@ -40,7 +42,6 @@ public interface XmppTestContainerSupport {
|
||||
*/
|
||||
String JANE_USER = "jane";
|
||||
|
||||
|
||||
/**
|
||||
* Password for sample users.
|
||||
*/
|
||||
@@ -54,7 +55,10 @@ public interface XmppTestContainerSupport {
|
||||
/**
|
||||
* The container.
|
||||
*/
|
||||
XmppContainer XMPP_CONTAINER = new XmppContainer();
|
||||
GenericContainer<?> XMPP_CONTAINER = new GenericContainer<>("fishbowler/openfire:v4.7.0")
|
||||
.withExposedPorts(5222)
|
||||
.withClasspathResourceMapping("xmpp/conf", "/var/lib/openfire/conf", BindMode.READ_ONLY)
|
||||
.withCommand("-demoboot");
|
||||
|
||||
@BeforeAll
|
||||
static void startContainer() {
|
||||
|
||||
Reference in New Issue
Block a user