diff options
author | Harald Musum <musum@yahoo-inc.com> | 2017-02-01 12:45:27 +0100 |
---|---|---|
committer | Harald Musum <musum@yahoo-inc.com> | 2017-02-01 12:45:27 +0100 |
commit | 3fa51973b15a1561deacc24487016acd237cf5a7 (patch) | |
tree | 9582e23c694899da0a72127485e4a4c85d733dbc /configserver | |
parent | 6ac1aa95be67abf5a61e65d75669d0540fbf5ed5 (diff) |
Test with URLs that are what will be actually used
Diffstat (limited to 'configserver')
-rw-r--r-- | configserver/src/test/java/com/yahoo/vespa/config/server/application/ApplicationConvergenceCheckerTest.java | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/application/ApplicationConvergenceCheckerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/application/ApplicationConvergenceCheckerTest.java index d4226f82005..2144767be40 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/application/ApplicationConvergenceCheckerTest.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/application/ApplicationConvergenceCheckerTest.java @@ -59,7 +59,8 @@ public class ApplicationConvergenceCheckerTest { @Test public void converge() throws IOException, SAXException { - ApplicationConvergenceChecker checker = new ApplicationConvergenceChecker((client, serviceUri) -> () -> string2json("{\"config\":{\"generation\":3}}")); + ApplicationConvergenceChecker checker = new ApplicationConvergenceChecker( + (client, serviceUri) -> () -> string2json("{\"config\":{\"generation\":3}}")); final HttpResponse httpResponse = checker.listConfigConvergence(application, URI.create("http://foo:234/serviceconverge")); assertThat(httpResponse.getStatus(), is(200)); assertJsonResponseEquals(httpResponse, "{\"services\":[" + @@ -68,21 +69,25 @@ public class ApplicationConvergenceCheckerTest { "\"type\":\"container\"}]," + "\"debug\":{\"wantedVersion\":3}," + "\"url\":\"http://foo:234/serviceconverge\"}"); - final HttpResponse nodeHttpResponse = checker.nodeConvergenceCheck(application, "localhost:1337", URI.create("http://foo:234/serviceconverge")); + final HttpResponse nodeHttpResponse = checker.nodeConvergenceCheck(application, + "localhost:1337", + URI.create("http://foo:234/serviceconverge/localhost:1337")); assertThat(nodeHttpResponse.getStatus(), is(200)); assertJsonResponseEquals(nodeHttpResponse, "{" + "\"converged\":true," + "\"debug\":{\"wantedGeneration\":3," + "\"currentGeneration\":3," + "\"host\":\"localhost:1337\"}," + - "\"url\":\"http://foo:234/serviceconverge\"}"); - final HttpResponse hostMissingHttpResponse = checker.nodeConvergenceCheck(application, "notPresent:1337", URI.create("http://foo:234/serviceconverge")); + "\"url\":\"http://foo:234/serviceconverge/localhost:1337\"}"); + final HttpResponse hostMissingHttpResponse = checker.nodeConvergenceCheck(application, + "notPresent:1337", + URI.create("http://foo:234/serviceconverge/notPresent:1337")); assertThat(hostMissingHttpResponse.getStatus(), is(410)); assertJsonResponseEquals(hostMissingHttpResponse, "{\"debug\":{" + "\"problem\":\"Host:port (service) no longer part of application, refetch list of services.\"," + "\"wantedGeneration\":3," + "\"host\":\"notPresent:1337\"}," + - "\"url\":\"http://foo:234/serviceconverge\"}"); + "\"url\":\"http://foo:234/serviceconverge/notPresent:1337\"}"); } private void assertJsonResponseEquals(HttpResponse httpResponse, String expected) throws IOException { |