Package-level declarations

Types

Link copied to clipboard
interface ApprovalContent

Determines which parts of the HttpMessage will be compared.

Link copied to clipboard
class ApprovalFailed(prefix: String, actual: ReadResource, expected: ReadResource) : RuntimeException
Link copied to clipboard
interface ApprovalSource

The backing store where the approved and actual content will be stored.

Link copied to clipboard

Standard Approval JUnit5 extension. Can be used to compare any HttpMessages.

Link copied to clipboard

Convert the output into a Comparable form.

Link copied to clipboard
interface Approver

Coordinates the comparison of the content for a test.

Link copied to clipboard
interface BaseApprovalTest : BeforeTestExecutionCallback, ParameterResolver

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

Link copied to clipboard
class CloudEventsJsonApprovalTest(testNamer: TestNamer = ClassAndMethod, approvalSource: ApprovalSource = FileSystemApprovalSource(File("src/test/resources"))) : ContentTypeAwareApprovalTest

Approval JUnit5 extension configured to compare prettified-JSON messages.

Link copied to clipboard
abstract class ContentTypeAwareApprovalTest(contentType: ContentType, testNamer: TestNamer = ClassAndMethod, approvalSource: ApprovalSource = FileSystemApprovalSource(File("src/test/resources"))) : BaseApprovalTest

Approval testing JUnit5 extension that checks the expected content type is present in the

Link copied to clipboard
class FileSystemApprovalSource(base: File, suffix: String = "") : ApprovalSource

Read the approval file from the file system, using an optional suffix

Link copied to clipboard
class HtmlApprovalTest(testNamer: TestNamer = ClassAndMethod, approvalSource: ApprovalSource = FileSystemApprovalSource(File("src/test/resources"))) : ContentTypeAwareApprovalTest

Approval JUnit5 extension configured to compare prettified-HTML messages. Note that this strips

Link copied to clipboard
class JsonApprovalTest(testNamer: TestNamer = ClassAndMethod, approvalSource: ApprovalSource = FileSystemApprovalSource(File("src/test/resources"))) : ContentTypeAwareApprovalTest

Approval JUnit5 extension configured to compare prettified-JSON messages.

Link copied to clipboard
class NamedResourceApprover(name: String, approvalContent: ApprovalContent, approvalSource: ApprovalSource, transformer: ApprovalTransformer<*> = ApprovalTransformer.StringWithNormalisedLineEndings()) : Approver
Link copied to clipboard
fun interface ReadResource
Link copied to clipboard
Link copied to clipboard
fun interface TestNamer

Provides the identification of test case.

Link copied to clipboard
class XmlApprovalTest(testNamer: TestNamer = ClassAndMethod, approvalSource: ApprovalSource = FileSystemApprovalSource(File("src/test/resources"))) : ContentTypeAwareApprovalTest

Approval JUnit5 extension configured to compare prettified-XML messages.

Link copied to clipboard
class YamlApprovalTest(testNamer: TestNamer = ClassAndMethod, approvalSource: ApprovalSource = FileSystemApprovalSource(File("src/test/resources"))) : ContentTypeAwareApprovalTest

Approval JUnit5 extension configured to compare prettified-YAML messages.

Functions

Link copied to clipboard
fun Approver.assertApproved(content: InputStream, contentType: ContentType? = null)
fun Approver.assertApproved(content: String, contentType: ContentType? = null)
fun Approver.assertApproved(response: Response, expectedStatus: Status)
Link copied to clipboard

Create a Hamkrest Matcher for this message that can be combined with other Matchers