in.specmatic.test.ResultAssert.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of junit5-support Show documentation
Show all versions of junit5-support Show documentation
Run contracts as tests in Junit tests using Specmatic.
Deprecation Notice for group ID "in.specmatic"
******************************************************************************************************
Updates for "junit5-support" will no longer be available under the deprecated group ID "in.specmatic".
Please update your dependencies to use the new group ID "io.specmatic".
******************************************************************************************************
The newest version!
package `in`.specmatic.test
import `in`.specmatic.core.Result
import org.assertj.core.api.AbstractAssert
class ResultAssert(result: Result) : AbstractAssert(result, ResultAssert::class.java) {
companion object {
fun assertThat(actual: Result): ResultAssert {
return ResultAssert(actual)
}
}
fun isSuccess() {
isNotNull
actual.let {
if(it is Result.Failure) {
failWithMessage(it.toFailureReport("Testing scenario").toText())
}
}
}
}