aboutsummaryrefslogtreecommitdiffstats
path: root/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ListApplicationsHandlerTest.java
diff options
context:
space:
mode:
authorJon Marius Venstad <venstad@gmail.com>2019-02-27 15:16:38 +0100
committerJon Marius Venstad <venstad@gmail.com>2019-02-28 11:21:28 +0100
commit43029702d7c5ab0fb82d3aaa8a3ca34c9802eabb (patch)
tree218f21ff25308dad497f2533f78b95a7ffa99e0a /configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ListApplicationsHandlerTest.java
parenta3a8b89a8066b352972c894730fa2b9fcbc72098 (diff)
Register applications in TenantApplications before activating their sessions
Diffstat (limited to 'configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ListApplicationsHandlerTest.java')
-rw-r--r--configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ListApplicationsHandlerTest.java28
1 files changed, 14 insertions, 14 deletions
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ListApplicationsHandlerTest.java b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ListApplicationsHandlerTest.java
index b34f7a0c487..f97bc443a38 100644
--- a/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ListApplicationsHandlerTest.java
+++ b/configserver/src/test/java/com/yahoo/vespa/config/server/http/v2/ListApplicationsHandlerTest.java
@@ -51,17 +51,17 @@ public class ListApplicationsHandlerTest {
final String url = "http://myhost:14000/application/v2/tenant/mytenant/application/";
assertResponse(url, Response.Status.OK,
"[]");
- applicationRepo.createPutTransaction(
- new ApplicationId.Builder().tenant("tenant").applicationName("foo").instanceName("quux").build(),
- 1).commit();
+ ApplicationId id1 = ApplicationId.from("mytenant", "foo", "quux");
+ applicationRepo.createApplication(id1);
+ applicationRepo.createPutTransaction(id1, 1).commit();
assertResponse(url, Response.Status.OK,
"[\"" + url + "foo/environment/dev/region/us-east/instance/quux\"]");
- applicationRepo.createPutTransaction(
- new ApplicationId.Builder().tenant("tenant").applicationName("bali").instanceName("quux").build(),
- 1).commit();
+ ApplicationId id2 = ApplicationId.from("mytenant", "bali", "quux");
+ applicationRepo.createApplication(id2);
+ applicationRepo.createPutTransaction(id2, 1).commit();
assertResponse(url, Response.Status.OK,
- "[\"" + url + "foo/environment/dev/region/us-east/instance/quux\"," +
- "\"" + url + "bali/environment/dev/region/us-east/instance/quux\"]"
+ "[\"" + url + "bali/environment/dev/region/us-east/instance/quux\"," +
+ "\"" + url + "foo/environment/dev/region/us-east/instance/quux\"]"
);
}
@@ -82,12 +82,12 @@ public class ListApplicationsHandlerTest {
@Test
public void require_that_listing_works_with_multiple_tenants() throws Exception {
- applicationRepo.createPutTransaction(new ApplicationId.Builder()
- .tenant("tenant")
- .applicationName("foo").instanceName("quux").build(), 1).commit();
- applicationRepo2.createPutTransaction(new ApplicationId.Builder()
- .tenant("tenant")
- .applicationName("quux").instanceName("foo").build(), 1).commit();
+ ApplicationId id1 = ApplicationId.from("mytenant", "foo", "quux");
+ applicationRepo.createApplication(id1);
+ applicationRepo.createPutTransaction(id1, 1).commit();
+ ApplicationId id2 = ApplicationId.from("foobar", "quux", "foo");
+ applicationRepo2.createApplication(id2);
+ applicationRepo2.createPutTransaction(id2, 1).commit();
String url = "http://myhost:14000/application/v2/tenant/mytenant/application/";
assertResponse(url, Response.Status.OK,
"[\"" + url + "foo/environment/dev/region/us-east/instance/quux\"]");