Build Status Coverage Status Codacy Badge SonarQube Tech Debt Maven Central Join the chat at

Gasper is a very simple integration testing JUnit harness for java -jar servers like WildFly Swarm and Spring Boot.

WildFly Swarm Spring Boot

Gasper provides a simple to use JUnit TestRule that can be used to build integration tests with simple apps, like REST micro-services. You can configure Gasper easily with a builder interface. Gasper will start the application before test class and stop it after tests completes.

Gasper supports currently only Maven. The pom.xml file is used to read project configuration achieving zero configuration operation.


Gasper utilize your packaged application. It It means it should be used in integration tests that run after application is being packaged by build tool (Maven). Add this code to your pom.xml file (if you didn't done that before):


Place your integration tests in classes that ends with *IT or *ITest.

WildFly Swarm configuration

public static Gasper gasper = Gasper.configurations()

Spring Boot configuration

public static Gasper gasper = Gasper.configurations()

Before running method, you can reconfigure those default configurations to your needs.

Example test method (Unirest + JSONAssert)

Gasper is best to use with libraries like Unirest for fetching data and asserting HTTP/S statuses and JSON Assert to validate correctness of JSON output for REST services.

public void testGetRoot() throws UnirestException {
  // given
  String address = gasper.getAddress(); // Address to deployed app, running live on random port
  String expectedMessage = "WildFly Swarm!";

  // when
  HttpResponse<String> response = Unirest.get(address).asString();

  // then
  assertThat(response.getBody()).field("hello").isEqualTo(expectedMessage); // JSON Assert

Additional configuration

To configure Gasper use GasperBuilder interface, for ex.:

private final int port = 11909;
private final String webContext = "/test";
private final String systemPropertyForPort = "swarm.http.port";

public static Gasper gasper = Gasper.configure()
  .withSystemProperty("swarm.context.path", webContext)
  .withSystemProperty(systemPropertyForPort, String.valueOf(port))
  .withJVMOptions("-server", "-Xms1G", "-Xmx1G", "-XX:+UseConcMarkSweepGC")
  .withEnvironmentVariable("jdbc.password", "S3CreT!1")





Contributions are welcome!

To contribute, follow the standard git flow of:

  1. Fork it
  2. Create your feature branch (git checkout -b feature/my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin feature/my-new-feature)
  5. Create new Pull Request

Even if you can't contribute code, if you have an idea for an improvement please open an issue.