Search in sources :

Example 1 with TenantKeyValues

use of org.killbill.billing.client.model.TenantKeyValues in project killbill by killbill.

the class TestTenantKV method testAllPluginConfig.

@Test(groups = "slow", description = "Retrieve per tenant keys and values based on a key prefix")
public void testAllPluginConfig() throws Exception {
    final String keyPrefix = "dummy_tenant";
    final String tenant1KeyName = "dummy_tenant_1_key";
    final String tenant1Value = "dummy_tenant_1_value";
    final TenantKeyValue tenant1Config = tenantApi.insertUserKeyValue(tenant1KeyName, tenant1Value, requestOptions);
    final String tenant2KeyName = "dummy_tenant_2_key";
    final String tenant2Value = "dummy_tenant_2_value";
    final TenantKeyValue tenant2Config = tenantApi.insertUserKeyValue(tenant2KeyName, tenant2Value, requestOptions);
    final TenantKeyValues tenantKeyValues = tenantApi.getAllPluginConfiguration(keyPrefix, requestOptions);
    Assert.assertFalse(tenantKeyValues.isEmpty());
    Assert.assertSame(tenantKeyValues.size(), 2);
    assertEquals(tenantKeyValues.get(0).getKey(), tenant1Config.getKey());
    assertEquals(tenantKeyValues.get(0).getValues(), tenant1Config.getValues());
    assertEquals(tenantKeyValues.get(1).getKey(), tenant2Config.getKey());
    assertEquals(tenantKeyValues.get(1).getValues(), tenant2Config.getValues());
}
Also used : TenantKeyValues(org.killbill.billing.client.model.TenantKeyValues) TenantKeyValue(org.killbill.billing.client.model.gen.TenantKeyValue) Test(org.testng.annotations.Test)

Aggregations

TenantKeyValues (org.killbill.billing.client.model.TenantKeyValues)1 TenantKeyValue (org.killbill.billing.client.model.gen.TenantKeyValue)1 Test (org.testng.annotations.Test)1