Search in sources :

Example 1 with Greeting

use of org.apache.dubbo.config.api.Greeting in project dubbo by alibaba.

the class DelegateProviderMetaDataInvokerTest method testDelegate.

@Test
public void testDelegate() throws Exception {
    DelegateProviderMetaDataInvoker<Greeting> delegate = new DelegateProviderMetaDataInvoker<Greeting>(invoker, service);
    delegate.getInterface();
    Mockito.verify(invoker).getInterface();
    delegate.getUrl();
    Mockito.verify(invoker).getUrl();
    delegate.isAvailable();
    Mockito.verify(invoker).isAvailable();
    Invocation invocation = Mockito.mock(Invocation.class);
    delegate.invoke(invocation);
    Mockito.verify(invoker).invoke(invocation);
    delegate.destroy();
    Mockito.verify(invoker).destroy();
    assertThat(delegate.getMetadata(), sameInstance(service));
}
Also used : Greeting(org.apache.dubbo.config.api.Greeting) Invocation(org.apache.dubbo.rpc.Invocation) Test(org.junit.jupiter.api.Test)

Aggregations

Greeting (org.apache.dubbo.config.api.Greeting)1 Invocation (org.apache.dubbo.rpc.Invocation)1 Test (org.junit.jupiter.api.Test)1