Search in sources :

Example 6 with ServicePathManager

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);
}
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)6 MicroserviceMeta (io.servicecomb.core.definition.MicroserviceMeta)5 RestOperationMeta (io.servicecomb.common.rest.definition.RestOperationMeta)2 OperationLocator (io.servicecomb.common.rest.locator.OperationLocator)2 SchemaMeta (io.servicecomb.core.definition.SchemaMeta)2 OperationMeta (io.servicecomb.core.definition.OperationMeta)1 ConsumerSchemaFactory (io.servicecomb.core.definition.schema.ConsumerSchemaFactory)1 InvocationException (io.servicecomb.core.exception.InvocationException)1 ReferenceConfig (io.servicecomb.core.provider.consumer.ReferenceConfig)1 SwaggerGenerator (io.servicecomb.swagger.generator.core.SwaggerGenerator)1 Swagger (io.swagger.models.Swagger)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Mock (mockit.Mock)1 Test (org.junit.Test)1 ApplicationContext (org.springframework.context.ApplicationContext)1