-
Notifications
You must be signed in to change notification settings - Fork 138
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add Testcontainers connector module
- Provide test actions to interact with Testcontainers - Add AWS2 LocalStack container support - Add PostgreSQL container support - Add XML DSL support - Add YAML DSL support
- Loading branch information
1 parent
188fb53
commit d736fc8
Showing
83 changed files
with
6,753 additions
and
127 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
121 changes: 0 additions & 121 deletions
121
...kubernetes/src/main/java/org/citrusframework/kubernetes/actions/ClusterConnectAction.java
This file was deleted.
Oops, something went wrong.
82 changes: 82 additions & 0 deletions
82
...ernetes/src/main/java/org/citrusframework/kubernetes/actions/KubernetesConnectAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* | ||
* Copyright 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 | ||
* | ||
* http://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.citrusframework.kubernetes.actions; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
|
||
import org.citrusframework.context.TestContext; | ||
import org.citrusframework.kubernetes.KubernetesVariableNames; | ||
|
||
/** | ||
* Connects to a Kubernetes cluster. | ||
*/ | ||
public class KubernetesConnectAction extends AbstractKubernetesAction implements KubernetesAction { | ||
|
||
public KubernetesConnectAction(Builder builder) { | ||
super("kubernetes-connect", builder); | ||
} | ||
|
||
@Override | ||
public void doExecute(TestContext context) { | ||
if (isDisabled(context)) { | ||
return; | ||
} | ||
|
||
context.setVariable(KubernetesVariableNames.CONNECTED.value(), true); | ||
} | ||
|
||
/** | ||
* Action builder. | ||
*/ | ||
public static class Builder extends AbstractKubernetesAction.Builder<KubernetesConnectAction, Builder> { | ||
|
||
private String containerImage; | ||
private final Map<String, String> annotations = new HashMap<>(); | ||
private final Map<String, String> labels = new HashMap<>(); | ||
|
||
public Builder image(String containerImage) { | ||
this.containerImage = containerImage; | ||
return this; | ||
} | ||
|
||
public Builder annotations(Map<String, String>annotations) { | ||
this.annotations.putAll(annotations); | ||
return this; | ||
} | ||
|
||
public Builder annotation(String annotation, String value) { | ||
this.annotations.put(annotation, value); | ||
return this; | ||
} | ||
|
||
public Builder labels(Map<String, String>labels) { | ||
this.labels.putAll(labels); | ||
return this; | ||
} | ||
|
||
public Builder label(String label, String value) { | ||
this.labels.put(label, value); | ||
return this; | ||
} | ||
|
||
@Override | ||
public KubernetesConnectAction doBuild() { | ||
return new KubernetesConnectAction(this); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>org.citrusframework</groupId> | ||
<artifactId>citrus-connectors</artifactId> | ||
<version>4.4.0-SNAPSHOT</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
|
||
<artifactId>citrus-testcontainers</artifactId> | ||
<name>Citrus :: Connectors :: Testcontainers</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.citrusframework</groupId> | ||
<artifactId>citrus-base</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.citrusframework</groupId> | ||
<artifactId>citrus-kubernetes</artifactId> | ||
<version>${project.version}</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.testcontainers</groupId> | ||
<artifactId>testcontainers</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.github.docker-java</groupId> | ||
<artifactId>docker-java-transport-okhttp</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.testcontainers</groupId> | ||
<artifactId>mongodb</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.testcontainers</groupId> | ||
<artifactId>postgresql</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.testcontainers</groupId> | ||
<artifactId>redpanda</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.testcontainers</groupId> | ||
<artifactId>kafka</artifactId> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-dbcp2</artifactId> | ||
</dependency> | ||
|
||
<!-- AWS Localstack --> | ||
<dependency> | ||
<groupId>software.amazon.awssdk</groupId> | ||
<artifactId>auth</artifactId> | ||
</dependency> | ||
|
||
<!-- Test scoped dependencies --> | ||
<dependency> | ||
<groupId>org.citrusframework</groupId> | ||
<artifactId>citrus-test-support</artifactId> | ||
<version>${project.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.citrusframework</groupId> | ||
<artifactId>citrus-testng</artifactId> | ||
<version>${project.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.citrusframework</groupId> | ||
<artifactId>citrus-spring</artifactId> | ||
<version>${project.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.citrusframework</groupId> | ||
<artifactId>citrus-xml</artifactId> | ||
<version>${project.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.citrusframework</groupId> | ||
<artifactId>citrus-yaml</artifactId> | ||
<version>${project.version}</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.postgresql</groupId> | ||
<artifactId>postgresql</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
Oops, something went wrong.