diff --git a/java/server/test/org/openqa/grid/internal/BaseRemoteProxyTest.java b/java/server/test/org/openqa/grid/internal/BaseRemoteProxyTest.java index 54c674f3b54fa..ad6456ec15e31 100644 --- a/java/server/test/org/openqa/grid/internal/BaseRemoteProxyTest.java +++ b/java/server/test/org/openqa/grid/internal/BaseRemoteProxyTest.java @@ -123,6 +123,24 @@ public void proxyConfigOverwritesRegistryConfig() { assertEquals(50L, p.getConfig().maxSession.longValue()); } + @Test + public void remoteHostParameterIsTakenInProxyAndRegistry() { + GridRegistry registry = DefaultGridRegistry.newInstance(new Hub(new GridHubConfiguration())); + + GridNodeConfiguration nodeConfiguration = parseCliOptions("-remoteHost", "http://machine1:5555"); + RegistrationRequest req = RegistrationRequest.build(nodeConfiguration); + req.getConfiguration().proxy = null; + + RemoteProxy p = BaseRemoteProxy.getNewInstance(req, registry); + registry.add(p); + + // values which are present in both the registration request and the registry need to + // come from the registration request + assertEquals("http://machine1:5555", p.getConfig().getRemoteHost()); + assertEquals("http://machine1:5555", + registry.getProxyById(p.getId()).getRemoteHost().toExternalForm()); + } + @Test public void proxyTakesRemoteAsIdIfIdNotSpecified() { String remoteHost ="http://machine1:5555";