Class MockDelegate<S>
- java.lang.Object
-
- org.gcube.common.clients.delegates.MockDelegate<S>
-
- Type Parameters:
S- the type of service endpoint stubs used byCalls
- All Implemented Interfaces:
ProxyDelegate<S>
public class MockDelegate<S> extends Object implements ProxyDelegate<S>
AProxyDelegatefor mock testing.- Author:
- Fabio Simeoni
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ProxyConfig<?,S>config()Returns the configuration of the proxy.<V> Vmake(Call<S,V> call)Makes aCallto a given service endpoint.static <S> ProxyDelegate<S>mockDelegate(ProxyPlugin<?,S,?> plugin, S endpoint)Creates an instance with aProxyPluginand a mock endpoints.
-
-
-
Method Detail
-
mockDelegate
public static <S> ProxyDelegate<S> mockDelegate(ProxyPlugin<?,S,?> plugin, S endpoint)
Creates an instance with aProxyPluginand a mock endpoints.- Parameters:
plugin- the pluginendpoint- the endpoint
-
make
public <V> V make(Call<S,V> call) throws Exception
Description copied from interface:ProxyDelegateMakes aCallto a given service endpoint.- Specified by:
makein interfaceProxyDelegate<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:ProxyDelegateReturns the configuration of the proxy.- Specified by:
configin interfaceProxyDelegate<S>- Returns:
- the configuration
-
-