diff options
author | Harald Musum <musum@oath.com> | 2017-11-09 08:28:28 +0100 |
---|---|---|
committer | Harald Musum <musum@oath.com> | 2017-11-09 08:29:11 +0100 |
commit | 36a10b2b78d2739850346293f7535bad9fb24f8e (patch) | |
tree | 2845297a2805f88df1bf1911f581203348179d76 /configserver | |
parent | 9c0ef1eaf92e341534497ca67f65b8f128d18e50 (diff) |
Use Tenants already created in @Before
Diffstat (limited to 'configserver')
-rw-r--r-- | configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantsTestCase.java | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantsTestCase.java b/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantsTestCase.java index 5802edfad36..59dec6946f9 100644 --- a/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantsTestCase.java +++ b/configserver/src/test/java/com/yahoo/vespa/config/server/tenant/TenantsTestCase.java @@ -146,25 +146,23 @@ public class TenantsTestCase extends TestWithCurator { @Test public void testTenantWatching() throws Exception { - TestComponentRegistry reg = new TestComponentRegistry.Builder().curator(curator).build(); - Tenants t = new Tenants(reg, Metrics.createTestMetrics()); TenantName newTenant = TenantName.from("newTenant"); List<TenantName> expectedTenants = Arrays.asList(TenantName.defaultName(), newTenant); try { - t.addTenant(newTenant); + tenants.addTenant(newTenant); // Poll for the watcher to pick up the tenant from zk, and add it int tries=0; while(true) { if (tries > 5000) fail("Didn't react on watch"); - if (t.getAllTenantNames().containsAll(expectedTenants)) { + if (tenants.getAllTenantNames().containsAll(expectedTenants)) { break; } tries++; Thread.sleep(10); } } finally { - assertTrue(t.getAllTenantNames().containsAll(expectedTenants)); - t.close(); + assertTrue(tenants.getAllTenantNames().containsAll(expectedTenants)); + tenants.close(); } } |