A fluent testing and assertions library.
Replace {release}
with the latest release version.
The latest developmental version can be found in the gradle.properties
file.
repositories {
maven("https://repo.sparky983.me/releases")
}
dependencies {
implementation("me.sparky983:spark-test:{release}")
}
repositories {
maven {
url "https://repo.sparky983.me/releases"
}
}
dependencies {
implementation "me.sparky983:spark-test:{release}"
}
<repositories>
<repository>
<id>sparky</id>
<url>https://repo.sparky983.me/releases</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>me.sparky983</groupId>
<artifactId>spark-test</artifactId>
<version>{release}</version>
</dependency>
</dependencies>
// static imports
given("some epic string")
.noop()
.then(startsWith("some"))
.and(contains("epic"));
// standard
Given.given("some epic string")
.noop()
.then(Assertion.startsWith("some"))
.and(Assertion.contains("epic"));
// with static imports
when(() -> Objects.requireNonNull(null))
.then(throwsException(NullPointerException.class));
// standard
When.when(() -> Objects.requireNonNull(null))
.then(Assertion.throwsException(NullPointerException.class))
This project was inspired by AssertJ.