All Downloads are FREE. Search and download functionalities are using the official Maven repository.

in.specmatic.test.ResultAssert.kt Maven / Gradle / Ivy

Go to download

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())
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy