use of org.eclipse.microprofile.openapi.OASFilter in project wildfly-swarm by wildfly-swarm.
the class FilterUtilTest method testApplyFilter.
/**
* Test method for {@link org.wildfly.swarm.microprofile.openapi.api.util.FilterUtil#applyFilter(org.eclipse.microprofile.openapi.OASFilter, org.eclipse.microprofile.openapi.models.OpenAPI)}.
* @throws Exception
*/
@Test
public void testApplyFilter() throws Exception {
URL beforeUrl = FilterUtilTest.class.getResource("filter-before.json");
URL afterUrl = FilterUtilTest.class.getResource("filter-after.json");
OpenAPIImpl model = OpenApiParser.parse(beforeUrl);
OASFilter filter = filter();
model = (OpenAPIImpl) FilterUtil.applyFilter(filter, model);
String actual = OpenApiSerializer.serialize(model, Format.JSON);
String expected = loadResource(afterUrl);
assertJsonEquals(expected, actual);
}
Aggregations