# \`testcontainers-ignition\`: a Java library for testing with Ignition Docker containers

**URL:** <https://forum.inductiveautomation.com/t/testcontainers-ignition-a-java-library-for-testing-with-ignition-docker-containers/94803>\
**Category:** Module Development\
**Tags:** perspective\
**Created:** [August 19, 2024, 1:51pm UTC](https://forum.inductiveautomation.com/t/testcontainers-ignition-a-java-library-for-testing-with-ignition-docker-containers/94803 "2024-08-19T13:51:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [August 19, 2024, 1:51pm UTC](https://forum.inductiveautomation.com/t/testcontainers-ignition-a-java-library-for-testing-with-ignition-docker-containers/94803/1 "2024-08-19T13:51:01Z")

</div>

[Testcontainers](https://java.testcontainers.org/) 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.  
Developing a module and want to automatically start a gateway, load your module, and test against it? This library is for you!

## Example

Java, using `try-with-resources`:

```java
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!
    }
}

```

### Gradle

```kotlin
dependencies {
    testImplementation("com.mussonindustrial:testcontainers-ignition:0.1.0")
}

```

### Maven

```xml
<dependency>
    <groupId>com.mussonindustrial</groupId>
    <artifactId>testcontainers-ignition</artifactId>
    <version>0.3.0</version>
</dependency>

```

Future work:

1. Version **1.0.0** after more testing.
2. Might eventually combine this with my [Node.js version](https://github.com/mussonindustrial/pyro/tree/main/packages/pyro-gateway) and try to submit it as a proper [testcontainers community module](https://testcontainers.com/modules/). Unless IA wants to help make it official… 👀
3. **8.3** support. Right now there's an only small amount of configuration you can reasonably apply to a gateway (without jumping through multiple hoops), but that's going to change with 8.3.

## Sources

> **[GitHub - mussonindustrial/testcontainers-ignition: A testcontainers implementation for Ignition by...](https://github.com/mussonindustrial/testcontainers-ignition/)**
>
> A testcontainers implementation for Ignition by Inductive Automation.

## Sponsorship

If you benefit from this library for commercial use, we ask you to consider sponsoring our efforts through [GitHub sponsors](https://github.com/sponsors/mussonindustrial). Your support will allow us to continue development of open-source modules and tools that benefit the entire community (plus there are some bonuses for sponsors 🙂).

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 19, 2024, 2:10pm UTC](https://forum.inductiveautomation.com/t/testcontainers-ignition-a-java-library-for-testing-with-ignition-docker-containers/94803/2 "2024-08-19T14:10:22Z")

</div>

Neat, I was just exploring/researching this idea the other week.

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 25, 2024, 5:45pm UTC](https://forum.inductiveautomation.com/t/testcontainers-ignition-a-java-library-for-testing-with-ignition-docker-containers/94803/3 "2024-08-25T17:45:27Z")

</div>

I submitted a couple PRs to your repo, one cosmetic, and one with a change that allows additional exposed ports to be configured.

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [August 25, 2024, 8:33pm UTC](https://forum.inductiveautomation.com/t/testcontainers-ignition-a-java-library-for-testing-with-ignition-docker-containers/94803/4 "2024-08-25T20:33:39Z")

</div>

Thanks for bump, I didn’t have any notifications on. 🙈

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [August 26, 2024, 9:24pm UTC](https://forum.inductiveautomation.com/t/testcontainers-ignition-a-java-library-for-testing-with-ignition-docker-containers/94803/5 "2024-08-26T21:24:09Z")

</div>

Version 0.2.0 is released, now with:

- Checks for missing gateway backup/third-party module files.
- Changes to mapped port methods.
- Better testing.
- Closer alignment to testcontainers conventions.
- [Javadocs](https://javadoc.io/doc/com.mussonindustrial/testcontainers-ignition/latest/com/mussonindustrial/testcontainers/ignition/package-summary.html)

FYI, all releases before 1.0.0 should be considered unstable.

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [September 3, 2024, 1:23pm UTC](https://forum.inductiveautomation.com/t/testcontainers-ignition-a-java-library-for-testing-with-ignition-docker-containers/94803/6 "2024-09-03T13:23:51Z")

</div>

Version 0.3.0 is out!

Changes from 0.2.X:

- Users must accept the EULA themselves through `.acceptLicense()`.
- Added support for additional JVM/Wrapper/Gateway arguments.
- Refactored Modules into an interface, for when IA releases modules that are not known by this library.
- Better regression tests.
- Listed in the testcontainers community registry!

> **[Testcontainers Ignition Module](https://testcontainers.com/modules/ignition/)**
>
> Start testing with real dependencies using the Ignition Module for Testcontainers for

---

<div class="post-metadata">

**Author:** ![bmusson](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bmusson/32/87530_2.png) [@bmusson](https://forum.inductiveautomation.com/u/bmusson)\
**Post date:** [August 4, 2026, 8:45pm UTC](https://forum.inductiveautomation.com/t/testcontainers-ignition-a-java-library-for-testing-with-ignition-docker-containers/94803/7 "2026-08-04T20:45:26Z")

</div>

## Release Notice, `v0.5.0`

This release adds 8.3 support, and preps the library for future capabilities/Docker image changes.

> **[Release Release v0.5.0 · mussonindustrial/testcontainers-ignition](https://github.com/mussonindustrial/testcontainers-ignition/releases/tag/v0.5.0)**
>
> Changelog
> 88886a8 Release/0.5.0 (#87)
> bcd966d update version to 0.5.0 (#85)
> 2114c61 Bump junit-jupiter from 5.12.2 to 6.1.2 (#67)
> 8ee3462 Bump org.jreleaser from 1.18.0 to 1.25.0 (#76)
> b1013fc Bump...

New things:

- Better health check.
- Full third-party module support for `8.3`.
  - Third-party module certificates and licenses are automatically accepted.
  - Third-party modules dependencies are automatically included (i.e. if a module depends on Perspective, Perspective will automatically be included).

- Added `withAllowUnsignedModules`, to enable unsigned module support.
- Added dedicated "profiles" for `8.1` and `8.3`, allowing the library to support both existing versions + future versions.
  - Profiles have their own set of supported container capabilities.
  - Warnings are thrown if you try to use a capability that is not supported by the Ignition container version (i.e. trying to use `withQuickStart` on `< 8.1.23`).

Thanks to @Kevin.Herron for health check and `module.xml` parsing ideas!
