use of io.syndesis.server.connector.generator.swagger.SwaggerModelInfo in project syndesis by syndesisio.
the class SwaggerHelperTest method testThatInvalidFieldPetstoreSwaggerIsInvalid.
@Test
public void testThatInvalidFieldPetstoreSwaggerIsInvalid() throws IOException {
final String specification = resource("/swagger/invalid/invalid-field.petstore.swagger.json");
final SwaggerModelInfo info = SwaggerHelper.parse(specification, true);
assertThat(info.getErrors()).hasSize(1);
assertThat(info.getWarnings()).isEmpty();
assertThat(info.getErrors().get(0).message()).startsWith("object instance has properties which are not allowed by the schema");
assertThat(info.getErrors().get(0).property()).contains("/paths/~1pet/put");
assertThat(info.getErrors().get(0).error()).contains("validation");
}
use of io.syndesis.server.connector.generator.swagger.SwaggerModelInfo in project syndesis by syndesisio.
the class SwaggerHelperTest method testThatInvalidSchemePetstoreSwaggerIsInvalid.
@Test
public void testThatInvalidSchemePetstoreSwaggerIsInvalid() throws IOException {
final String specification = resource("/swagger/invalid/invalid-scheme.petstore.swagger.json");
final SwaggerModelInfo info = SwaggerHelper.parse(specification, true);
assertThat(info.getErrors()).hasSize(1);
assertThat(info.getWarnings()).isEmpty();
assertThat(info.getErrors().get(0).message()).startsWith("instance value (\"httpz\") not found in enum");
assertThat(info.getErrors().get(0).property()).contains("/schemes/0");
assertThat(info.getErrors().get(0).error()).contains("validation");
}
Aggregations