use of io.swagger.jaxrs.config.WebXMLReader in project swagger-core by swagger-api.
the class SwaggerContextServiceTest method initializeAndGetConfigBasedOnPath.
@Test(description = "should add SwaggerConfig to SwaggerConfigLocator map with keys path-based keys")
public void initializeAndGetConfigBasedOnPath() {
stubWithPathBasedConfigInitParam();
new SwaggerContextService().withServletConfig(servletConfig1).withBasePath("/url1").initConfig();
new SwaggerContextService().withServletConfig(servletConfig2).withBasePath("url2").initConfig();
assertTrue(SwaggerConfigLocator.getInstance().getConfig(CONFIG_ID_PREFIX + "/url1/") instanceof WebXMLReader);
assertTrue(SwaggerConfigLocator.getInstance().getConfig(CONFIG_ID_PREFIX + "/url2/") instanceof WebXMLReader);
verify(servletConfig1, times(1)).getInitParameter(eq(USE_PATH_BASED_CONFIG));
verify(servletConfig2, times(1)).getInitParameter(eq(USE_PATH_BASED_CONFIG));
}
Aggregations