rpatrick00
6 years agoContributor
Unit Test failure: Non existent view: error0
I am writing a custom transformation snap to build a custom payload for one of our external systems. I have implemented the ErrorSchemaProvider interface and, following the patterns of the view names from the InputSchemaProvider and OutputSchemaProvider, I specified the view name as “error0”.
@Override public void defineErrorSchema(final SchemaProvider provider) { provider.getSchemaBuilder("error0") .withChildSchema(provider.createSchema(SnapType.STRING, BAR_NUMBER)) .withChildSchema(provider.createSchema(SnapType.STRING, ERROR_TYPE)) .withChildSchema(provider.createSchema(SnapType.STRING, ERROR_MESSAGE)) .build(); }
Unfortunately, this is causing the unit test to fail with the error: Non existent view: error0
@RunWith(SnapTestRunner.class)
public class AddAttorneyPayloadBuilderTest {@TestFixture(snap = AddAttorneyPayloadBuilder.class, input = "data/add_attorney/input.json", errors = { "error0" }, expectedOutputPath = "data/add_attorney/expected", expectedErrorPath = "data/two_inputs_two_outputs/expected") public void addAttorney_WithValidData_BuildsXmlPayload() { }
}
I am clearly doing something stupid. Any pointers at what I need to do to fix the problem?
Thanks,
Robert