public TenantModelDao(final Tenant tenant) { this(tenant.getId(), tenant.getCreatedDate(), tenant.getUpdatedDate(), tenant.getExternalKey(), tenant.getApiKey(), tenant.getApiSecret(), null); }
@Test(groups = "slow") public void testTenant() throws Exception { final TenantData tenantdata = new DefaultTenant(UUID.randomUUID(), clock.getUTCNow(), clock.getUTCNow(), "er44TT-yy4r", "TTR445ee2", "dskjhfs^^54R"); tenantUserApi.createTenant(tenantdata, callContext); final Tenant tenant = tenantUserApi.getTenantByApiKey(tenantdata.getApiKey()); Assert.assertEquals(tenant.getApiKey(), tenantdata.getApiKey()); Assert.assertEquals(tenant.getExternalKey(), tenantdata.getExternalKey()); // The second time, the value is already in the cache so the TenantCacheLoader is not invoked final Tenant tenant2 = tenantUserApi.getTenantByApiKey(tenantdata.getApiKey()); Assert.assertEquals(tenant2.getApiKey(), tenantdata.getApiKey()); Assert.assertEquals(tenant2.getExternalKey(), tenantdata.getExternalKey()); }
public TenantJson(final Tenant tenant) { this(tenant.getId(), tenant.getExternalKey(), tenant.getApiKey(), tenant.getApiSecret()); }
public TenantModelDao(final Tenant tenant) { this(tenant.getId(), tenant.getCreatedDate(), tenant.getUpdatedDate(), tenant.getExternalKey(), tenant.getApiKey(), tenant.getApiSecret(), null); }
tenantCacheController.remove(currentTenant.getApiKey());
@Test(groups = "slow") public void testTenant() throws Exception { final TenantData tenantdata = new DefaultTenant(UUID.randomUUID(), clock.getUTCNow(), clock.getUTCNow(), "er44TT-yy4r", "TTR445ee2", "dskjhfs^^54R"); tenantUserApi.createTenant(tenantdata, callContext); final Tenant tenant = tenantUserApi.getTenantByApiKey(tenantdata.getApiKey()); Assert.assertEquals(tenant.getApiKey(), tenantdata.getApiKey()); Assert.assertEquals(tenant.getExternalKey(), tenantdata.getExternalKey()); // The second time, the value is already in the cache so the TenantCacheLoader is not invoked final Tenant tenant2 = tenantUserApi.getTenantByApiKey(tenantdata.getApiKey()); Assert.assertEquals(tenant2.getApiKey(), tenantdata.getApiKey()); Assert.assertEquals(tenant2.getExternalKey(), tenantdata.getExternalKey()); }