in.specmatic.test.SpecmaticContractTest.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 org.junit.jupiter.api.DynamicTest
import org.junit.jupiter.api.TestFactory
import org.junit.jupiter.api.extension.AfterTestExecutionCallback
import org.junit.jupiter.api.extension.ExtendWith
import org.junit.jupiter.api.extension.ExtensionContext
import java.util.stream.Stream
@ExtendWith(AfterSpecmaticContractTestExecutionCallback::class)
interface SpecmaticContractTest {
@TestFactory
fun contractTest(): Stream {
return SpecmaticJUnitSupport().contractTest()
}
}
class AfterSpecmaticContractTestExecutionCallback : AfterTestExecutionCallback {
override fun afterTestExecution(context: ExtensionContext?) {
SpecmaticJUnitSupport.report()
}
}