use of io.swagger.v3.core.filter.resources.NoGetOperationsFilter in project swagger-core by swagger-api.
the class SpecFilterTest method filterAwayGetOperations.
@Test(description = "it should filter away get operations in a resource")
public void filterAwayGetOperations() throws IOException {
final OpenAPI openAPI = getOpenAPI(RESOURCE_PATH);
final NoGetOperationsFilter filter = new NoGetOperationsFilter();
final OpenAPI filtered = new SpecFilter().filter(openAPI, filter, null, null, null);
if (filtered.getPaths() != null) {
for (Map.Entry<String, PathItem> entry : filtered.getPaths().entrySet()) {
assertNull(entry.getValue().getGet());
}
} else {
fail("paths should not be null");
}
}
Aggregations