Search in sources :

Example 1 with ConsumerProviderManager

use of io.servicecomb.core.provider.consumer.ConsumerProviderManager in project java-chassis by ServiceComb.

the class TestConsumer method testConsumerProviderManager.

@SuppressWarnings({ "rawtypes", "unchecked" })
@Test
public void testConsumerProviderManager() {
    ConsumerProviderManager oConsumerProviderManager = new ConsumerProviderManager();
    RegisterManager oRegisterManager = new RegisterManager("cse consumer provider manager");
    oRegisterManager.register("cse.references.cse consumer provider manager", "cse consumer provider manager");
    boolean validAssert = true;
    try {
        oConsumerProviderManager.getReferenceConfig("consumer provider manager");
    } catch (Exception e) {
        Assert.assertNotEquals(null, e);
        validAssert = false;
    } catch (Throwable ee) {
        Assert.assertNotEquals(null, ee);
        validAssert = false;
    }
    Assert.assertFalse(validAssert);
}
Also used : RegisterManager(io.servicecomb.foundation.common.RegisterManager) ConsumerProviderManager(io.servicecomb.core.provider.consumer.ConsumerProviderManager) Test(org.junit.Test)

Example 2 with ConsumerProviderManager

use of io.servicecomb.core.provider.consumer.ConsumerProviderManager in project java-chassis by ServiceComb.

the class MockUtil method mockConsumerProviderManager.

public void mockConsumerProviderManager() {
    ConsumerProviderManager consumerProviderManager = new MockUp<ConsumerProviderManager>() {

        @Mock
        public ReferenceConfig getReferenceConfig(String microserviceName) {
            return new ReferenceConfig("test", "test", "test");
        }
    }.getMockInstance();
    CseContext.getInstance().setConsumerProviderManager(consumerProviderManager);
}
Also used : ConsumerProviderManager(io.servicecomb.core.provider.consumer.ConsumerProviderManager) ReferenceConfig(io.servicecomb.core.provider.consumer.ReferenceConfig) Mock(mockit.Mock)

Aggregations

ConsumerProviderManager (io.servicecomb.core.provider.consumer.ConsumerProviderManager)2 ReferenceConfig (io.servicecomb.core.provider.consumer.ReferenceConfig)1 RegisterManager (io.servicecomb.foundation.common.RegisterManager)1 Mock (mockit.Mock)1 Test (org.junit.Test)1