use of com.dtflys.forest.proxy.InterfaceProxyHandler in project forest by dromara.
the class TestInterfaceProxyHandler method testBaseURL.
@Test
public void testBaseURL() {
ProxyFactory<LocalhostBaseURLClient> getClientProxyFactory = new ProxyFactory<>(configuration, LocalhostBaseURLClient.class);
InterfaceProxyHandler<LocalhostBaseURLClient> interfaceProxyHandler = new InterfaceProxyHandler(configuration, getClientProxyFactory, LocalhostBaseURLClient.class);
MetaRequest metaRequest = interfaceProxyHandler.getBaseMetaRequest();
assertEquals("http://localhost", metaRequest.getUrl());
}
use of com.dtflys.forest.proxy.InterfaceProxyHandler in project forest by dromara.
the class TestInterfaceProxyHandler method testNonProtocolBaseURL.
@Test
public void testNonProtocolBaseURL() {
ProxyFactory<NonProtocolBaseURLClient> getClientProxyFactory = new ProxyFactory<>(configuration, NonProtocolBaseURLClient.class);
InterfaceProxyHandler<NonProtocolBaseURLClient> interfaceProxyHandler = new InterfaceProxyHandler(configuration, getClientProxyFactory, NonProtocolBaseURLClient.class);
MetaRequest metaRequest = interfaceProxyHandler.getBaseMetaRequest();
assertEquals("localhost", metaRequest.getUrl());
}
use of com.dtflys.forest.proxy.InterfaceProxyHandler in project forest by dromara.
the class TestInterfaceProxyHandler method testEmptyBaseURL.
@Test
public void testEmptyBaseURL() {
ProxyFactory<EmptyBaseURLClient> getClientProxyFactory = new ProxyFactory<>(configuration, EmptyBaseURLClient.class);
InterfaceProxyHandler<EmptyBaseURLClient> interfaceProxyHandler = new InterfaceProxyHandler(configuration, getClientProxyFactory, EmptyBaseURLClient.class);
MetaRequest metaRequest = interfaceProxyHandler.getBaseMetaRequest();
assertNull(metaRequest.getUrl());
}
Aggregations