Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
This project is a Testcontainers implementation for Ignition by Inductive Automation.
// build.gradle.kts
dependencies {
testImplementation("com.mussonindustrial:testcontainers-ignition:0.4.1")
}
<dependency>
<groupId>com.mussonindustrial</groupId>
<artifactId>testcontainers-ignition</artifactId>
<version>0.4.1</version>
<scope>test</scope>
</dependency>
void createIgnitionGateway() throws FileNotFoundException {
try (IgnitionContainer ignition = new IgnitionContainer("inductiveautomation/ignition:8.1.33")
.withCredentials("myUsername", "myPassword")
.withEdition(GatewayEdition.STANDARD)
.withModules(GatewayModule.PERSPECTIVE)
.withGatewayBackup("./path/to/backup.gwbk")
.withThirdPartyModules("./path/to/module.modl")
.acceptLicense()) {
ignition.start();
String url = ignition.getGatewayUrl();
// ... do something with your gateway!
}
}
Maintenance of this project is made possible by all our contributors and sponsors. If you'd like to sponsor this project and have your avatar or company logo appear below click here. 💖