{"id":20841529,"url":"https://github.com/wavesoftware/java-gasper","last_synced_at":"2025-09-12T03:19:39.625Z","repository":{"id":47661542,"uuid":"53201982","full_name":"wavesoftware/java-gasper","owner":"wavesoftware","description":"Very simple integration testing JUnit harness for 'java -jar' servers like WildFly Swarm and Spring Boot","archived":false,"fork":false,"pushed_at":"2024-01-06T18:04:01.000Z","size":99,"stargazers_count":1,"open_issues_count":13,"forks_count":2,"subscribers_count":2,"default_branch":"develop","last_synced_at":"2025-01-19T00:48:09.362Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://wavesoftware.github.io/java-gasper","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wavesoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2016-03-05T13:13:38.000Z","updated_at":"2018-03-07T09:40:58.000Z","dependencies_parsed_at":"2024-01-06T19:33:55.800Z","dependency_job_id":null,"html_url":"https://github.com/wavesoftware/java-gasper","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesoftware%2Fjava-gasper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesoftware%2Fjava-gasper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesoftware%2Fjava-gasper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesoftware%2Fjava-gasper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wavesoftware","download_url":"https://codeload.github.com/wavesoftware/java-gasper/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243197211,"owners_count":20251956,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-18T01:20:32.751Z","updated_at":"2025-03-12T10:21:48.322Z","avatar_url":"https://github.com/wavesoftware.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Gasper!\n\n[![Build Status](https://travis-ci.org/wavesoftware/java-gasper.svg?branch=develop)](https://travis-ci.org/wavesoftware/java-gasper) [![Coverage Status](https://coveralls.io/repos/github/wavesoftware/java-gasper/badge.svg?branch=develop)](https://coveralls.io/github/wavesoftware/java-gasper?branch=develop) [![Codacy Badge](https://api.codacy.com/project/badge/grade/5c4d1180812e438ebe872f9121ec4368)](https://www.codacy.com/app/krzysztof-suszynski/java-gasper) [![SonarQube Quality Gate](https://sonar.wavesoftware.pl/api/badges/gate?key=pl.wavesoftware:gasper)](https://sonar.wavesoftware.pl/dashboard?id=pl.wavesoftware%3Agasper) [![SonarQube Tech Debt](https://sonar.wavesoftware.pl/api/badges/measure?key=pl.wavesoftware:gasper\u0026metric=sqale_debt_ratio)](https://sonar.wavesoftware.pl/dashboard?id=pl.wavesoftware%3Agasper) [![Maven Central](https://img.shields.io/maven-central/v/pl.wavesoftware/gasper.svg)](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22pl.wavesoftware%22%20AND%20a%3A%22gasper%22) [![Join the chat at https://gitter.im/wavesoftware/java-gasper](https://badges.gitter.im/wavesoftware/java-gasper.svg)](https://gitter.im/wavesoftware/java-gasper?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\nGasper is a very simple integration testing JUnit harness for `java -jar` servers like [WildFly Swarm](http://wildfly-swarm.io/) and [Spring Boot](http://projects.spring.io/spring-boot/).\n\n[![WildFly Swarm](https://avatars3.githubusercontent.com/u/11523816?v=3\u0026s=100)](http://wildfly-swarm.io/) [![Spring Boot](https://avatars2.githubusercontent.com/u/317776?v=3\u0026s=100)](http://projects.spring.io/spring-boot/)\n\nGasper 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.\n\nGasper supports currently only [Maven](https://maven.apache.org/). The `pom.xml` file is used to read project configuration achieving zero configuration operation.\n\n## Usage\n\n\nGasper 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):\n\n```xml\n\u003cbuild\u003e\n[..]\n\u003cplugins\u003e\n[..]\n  \u003cplugin\u003e\n    \u003cgroupId\u003eorg.apache.maven.plugins\u003c/groupId\u003e\n    \u003cartifactId\u003emaven-failsafe-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e2.19.1\u003c/version\u003e\n    \u003cexecutions\u003e\n      \u003cexecution\u003e\n        \u003cgoals\u003e\n          \u003cgoal\u003eintegration-test\u003c/goal\u003e\n          \u003cgoal\u003everify\u003c/goal\u003e\n        \u003c/goals\u003e\n      \u003c/execution\u003e\n    \u003c/executions\u003e\n  \u003c/plugin\u003e\n[..]\n\u003c/plugins\u003e\n[..]\n\u003c/build\u003e\n```\n\n\nPlace your integration tests in classes that ends with `*IT` or `*ITest`.\n\n### WildFly Swarm configuration\n\n```java\n@ClassRule\npublic static Gasper gasper = Gasper.configurations()\n  .wildflySwarm()\n  .build();\n```\n\n### Spring Boot configuration\n\n```java\n@ClassRule\npublic static Gasper gasper = Gasper.configurations()\n  .springBoot()\n  .build();\n```\n\nBefore running `GasperBuilder.build()` method, you can reconfigure those default configurations to your needs.\n\n### Example test method (Unirest + JSONAssert)\n\nGasper is best to use with libraries like [Unirest](http://unirest.io/java.html) for fetching data and asserting HTTP/S statuses and [JSON Assert](https://github.com/marcingrzejszczak/jsonassert) to validate correctness of JSON output for REST services.\n\n```java\n@Test\npublic void testGetRoot() throws UnirestException {\n  // given\n  String address = gasper.getAddress(); // Address to deployed app, running live on random port\n  String expectedMessage = \"WildFly Swarm!\";\n\n  // when\n  HttpResponse\u003cString\u003e response = Unirest.get(address).asString();\n\n  // then\n  assertThat(response.getStatus()).isEqualTo(200);\n  assertThat(response.getBody()).field(\"hello\").isEqualTo(expectedMessage); // JSON Assert\n}\n```\n\n### Additional configuration\n\nTo configure Gasper use `GasperBuilder` interface, for ex.:\n\n```java\nprivate final int port = 11909;\nprivate final String webContext = \"/test\";\nprivate final String systemPropertyForPort = \"swarm.http.port\";\n\n@ClassRule\npublic static Gasper gasper = Gasper.configure()\n  .silentGasperMessages()\n  .usingSystemPropertyForPort(systemPropertyForPort)\n  .withSystemProperty(\"swarm.context.path\", webContext)\n  .withSystemProperty(systemPropertyForPort, String.valueOf(port))\n  .withJVMOptions(\"-server\", \"-Xms1G\", \"-Xmx1G\", \"-XX:+UseConcMarkSweepGC\")\n  .withMaxStartupTime(100)\n  .withMaxDeploymentTime(20)\n  .withEnvironmentVariable(\"jdbc.password\", \"S3CreT!1\")\n  .withTestApplicationLoggingOnConsole()\n  .usingPomFile(Paths.get(\"pom.xml\"))\n  .withArtifactPackaging(\"jar\")\n  .waitForWebContext(webContext)\n  .withArtifactClassifier(\"swarm\")\n  .usingWebContextChecker(GasperBuilderTest::checkContext)\n  .withPort(port)\n  .build();\n```\n\n## Installation\n\n### Maven\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003epl.wavesoftware\u003c/groupId\u003e\n    \u003cartifactId\u003egasper\u003c/artifactId\u003e\n    \u003cversion\u003e1.0.0\u003c/version\u003e\n    \u003cscope\u003etest\u003c/scope\u003e\n\u003c/dependency\u003e\n```\n\n## Contributing\n\nContributions are welcome!\n\nTo contribute, follow the standard [git flow](http://danielkummer.github.io/git-flow-cheatsheet/) of:\n\n1. Fork it\n1. Create your feature branch (`git checkout -b feature/my-new-feature`)\n1. Commit your changes (`git commit -am 'Add some feature'`)\n1. Push to the branch (`git push origin feature/my-new-feature`)\n1. Create new Pull Request\n\nEven if you can't contribute code, if you have an idea for an improvement please open an [issue](https://github.com/wavesoftware/java-gasper/issues).\n\n## Requirements\n\n* Java 8\n* Maven 3\n\n## Releases\n\n* `1.0.0` - codename: *SkyMango*\n\t* First publicly available release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesoftware%2Fjava-gasper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwavesoftware%2Fjava-gasper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesoftware%2Fjava-gasper/lists"}