Search in sources :

Example 1 with ConsumerSchemaFactory

use of io.servicecomb.core.definition.schema.ConsumerSchemaFactory 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);
}
Also used : MicroserviceMeta(io.servicecomb.core.definition.MicroserviceMeta) ConsumerSchemaFactory(io.servicecomb.core.definition.schema.ConsumerSchemaFactory) Mock(mockit.Mock) ServicePathManager(io.servicecomb.common.rest.locator.ServicePathManager)

Aggregations

ServicePathManager (io.servicecomb.common.rest.locator.ServicePathManager)1 MicroserviceMeta (io.servicecomb.core.definition.MicroserviceMeta)1 ConsumerSchemaFactory (io.servicecomb.core.definition.schema.ConsumerSchemaFactory)1 Mock (mockit.Mock)1