Kluent is a "Fluent Assertions" library written specifically for Kotlin.
It uses the Infix-Notations and Extension Functions of Kotlin to provide a fluent wrapper around the JUnit-Asserts and Mockito.
More examples can be seen in the Wiki or tests.
"hello" shouldEqual "hello"
"hello" shouldNotEqual "world"
val alice = Person("Alice", "Bob")
val jon = Person("Jon", "Doe")
val list = listOf(alice, jon)
list shouldContain jon
val stub = mock(Database::class)
val bob = Person("Bob", "Guy")
When calling stub.getPerson() itReturns bob
Kluent is hosted in jCenter
dependencies {
testCompile 'org.amshove.kluent:kluent:1.4'
}
<dependency>
<groupId>org.amshove.kluent</groupId>
<artifactId>kluent</artifactId>
<version>1.4</version>
<type>pom</type>
</dependency>