use of io.swagger.jaxrs.listing.ApiListingResource in project swagger-core by swagger-api.
the class ApiListingResourceTest method shouldHandleErrorServletConfig_issue1691.
@Test
public void shouldHandleErrorServletConfig_issue1691() throws JsonProcessingException {
ServletConfig sc = new ServletConfig() {
@Override
public String getServletName() {
throw new RuntimeException("test_1691");
}
@Override
public ServletContext getServletContext() {
throw new RuntimeException("test_1691");
}
@Override
public String getInitParameter(String name) {
throw new RuntimeException("test_1691");
}
@Override
public Enumeration getInitParameterNames() {
throw new RuntimeException("test_1691");
}
};
ApiListingResource a = new ApiListingResource();
try {
a.getListing(null, sc, null, null, "json");
} catch (RuntimeException e) {
// test will fail before, no need to mock Response
if (e.getCause() instanceof ClassNotFoundException) {
return;
}
throw e;
}
}
Aggregations