use of io.servicecomb.common.rest.locator.ServicePathManager in project java-chassis by ServiceComb.
the class MockUtil method mockRegisterManager.
public void mockRegisterManager() throws InstantiationException, IllegalAccessException {
MicroserviceMeta microserviceMeta = microserviceMetaManager.getOrCreateMicroserviceMeta("app:test");
microserviceMeta.putExtData("RestServicePathManager", new ServicePathManager(microserviceMeta));
ConsumerSchemaFactory consumerSchemaFactory = new MockUp<ConsumerSchemaFactory>() {
@Mock
public MicroserviceMeta getOrCreateConsumer(String microserviceName) {
return microserviceMeta;
}
}.getMockInstance();
CseContext.getInstance().setConsumerSchemaFactory(consumerSchemaFactory);
}
Aggregations