Closed
Description
JsonSchema
is a final class, so it's not able to be (cleanly) mocked in unit tests. This is important for testing classes that must handle validation failure and success scenarios.
The workaround is to wrap the schema validation in a local class, and mock that class. However, this just hides the problem at a lower level since the wrapped class cannot be properly tested.
If JsonSchema
implemented an interface, it could be mocked directly.
Metadata
Metadata
Assignees
Labels
No labels