api

http4k / org.http4k.testing / BaseApprovalTest

BaseApprovalTest

interface BaseApprovalTest : BeforeTestExecutionCallback, ParameterResolver (source)

Base JUnit extension for injecting an Approver into a JUnit5 test-case. Implement this to provide custom approval behaviours, or

Functions

Name Summary
approverFor abstract fun approverFor(context: ExtensionContext): Approver
beforeTestExecution open fun beforeTestExecution(context: ExtensionContext): Unit
resolveParameter open fun resolveParameter(parameterContext: ParameterContext, context: ExtensionContext): Any?
supportsParameter open fun supportsParameter(parameterContext: ParameterContext, context: ExtensionContext): Boolean

Extension Functions

Name Summary
with fun <T> T.with(vararg modifiers: (T) -> T): T

Inheritors

Name Summary
ApprovalTest class ApprovalTest : BaseApprovalTest
Standard Approval JUnit5 extension. Can be used to compare any HttpMessages.
ContentTypeAwareApprovalTest abstract class ContentTypeAwareApprovalTest : BaseApprovalTest
Approval testing JUnit5 extension that checks the expected content type is present in the