Class MockDelegate<S>

java.lang.Object
org.gcube.common.clients.delegates.MockDelegate<S>
Type Parameters:
S - the type of service endpoint stubs used by Calls
All Implemented Interfaces:
ProxyDelegate<S>

public class MockDelegate<S> extends Object implements ProxyDelegate<S>
A ProxyDelegate for mock testing.
Author:
Fabio Simeoni
  • Method Details

    • mockDelegate

      public static <S> ProxyDelegate<S> mockDelegate(ProxyPlugin<?,S,?> plugin, S endpoint)
      Creates an instance with a ProxyPlugin and a mock endpoints.
      Type Parameters:
      S - the type of service endpoint stubs
      Parameters:
      plugin - the plugin
      endpoint - the endpoint
      Returns:
      the delegate
    • make

      public <V> V make(Call<S,V> call) throws Exception
      Description copied from interface: ProxyDelegate
      Makes a Call to a given service endpoint.
      Specified by:
      make in interface ProxyDelegate<S>
      Type Parameters:
      V - the type of the value returned from the call
      Parameters:
      call - the call
      Returns:
      the value returned from the call
      Throws:
      Exception - if the call fails
    • config

      public ProxyConfig<?,S> config()
      Description copied from interface: ProxyDelegate
      Returns the configuration of the proxy.
      Specified by:
      config in interface ProxyDelegate<S>
      Returns:
      the configuration