use of org.apache.servicecomb.transport.rest.servlet.ServletRestTransport in project java-chassis by ServiceComb.
the class TestInspectorImpl method initInspector.
private static InspectorImpl initInspector(String urlPrefix) {
SCBEngine scbEngine = SCBBootstrap.createSCBEngineForTest();
scbEngine.getTransportManager().clearTransportBeforeInit();
if (StringUtils.isNotEmpty(urlPrefix)) {
Map<String, Transport> transportMap = Deencapsulation.getField(scbEngine.getTransportManager(), "transportMap");
transportMap.put(RESTFUL, new ServletRestTransport());
ClassLoaderScopeContext.setClassLoaderScopeProperty(DefinitionConst.URL_PREFIX, urlPrefix);
}
scbEngine.run();
InspectorImpl inspector = new InspectorImpl().setInspectorConfig(scbEngine.getPriorityPropertyManager().createConfigObject(InspectorConfig.class)).setSchemas(schemas);
inspector.correctBasePathForOnlineTest(scbEngine);
return inspector;
}
Aggregations