summaryrefslogtreecommitdiff
path: root/same/src
diff options
context:
space:
mode:
authorKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-01-31 14:13:57 +0100
committerKjetil Ørbekk <kjetil.orbekk@gmail.com>2012-01-31 14:13:57 +0100
commit2595e02a1b0304b82a5e7e2fe1f1dce0f7c69105 (patch)
treed450536569aadae4a255d9f4f130d6a97761ea06 /same/src
parent66bbea9deadc0cf559e2c84d248f1b86a7e59467 (diff)
Use full url with discovery.
Diffstat (limited to 'same/src')
-rw-r--r--same/src/main/java/com/orbekk/same/ClientServiceImpl.java5
-rw-r--r--same/src/test/java/com/orbekk/same/ClientServiceImplTest.java2
2 files changed, 3 insertions, 4 deletions
diff --git a/same/src/main/java/com/orbekk/same/ClientServiceImpl.java b/same/src/main/java/com/orbekk/same/ClientServiceImpl.java
index 658bf37..3ba8b04 100644
--- a/same/src/main/java/com/orbekk/same/ClientServiceImpl.java
+++ b/same/src/main/java/com/orbekk/same/ClientServiceImpl.java
@@ -149,14 +149,13 @@ public class ClientServiceImpl implements UrlReceiver,
@Override
public void discover(String url) {
- String clientUrl = url + "ClientService.json";
if (!url.equals(myUrl)) {
try {
- connections.getClient(clientUrl)
+ connections.getClient(url)
.notifyNetwork(state.getDataOf(".networkName"),
state.getDataOf(".masterUrl"));
} catch (Exception e) {
- logger.warn("Failed to contact new client {}: {}", clientUrl,
+ logger.warn("Failed to contact new client {}: {}", url,
throwableToString(e));
}
}
diff --git a/same/src/test/java/com/orbekk/same/ClientServiceImplTest.java b/same/src/test/java/com/orbekk/same/ClientServiceImplTest.java
index 5f04485..2cae247 100644
--- a/same/src/test/java/com/orbekk/same/ClientServiceImplTest.java
+++ b/same/src/test/java/com/orbekk/same/ClientServiceImplTest.java
@@ -31,7 +31,7 @@ public class ClientServiceImplTest {
ClientService mockClient = mock(ClientService.class);
connections.clientMap.put("mockClient/ClientService.json",
mockClient);
- client.discover("mockClient/");
+ client.discover("mockClient/ClientService.json");
verify(mockClient).notifyNetwork("ClientNetwork", "master");
}
}