use of org.bf2.cos.fleetshard.support.resources.Resources in project srs-fleet-manager by bf2fc6cc711aee1a0c2a.
the class RegistryProvisioningIT method testProvisionRegistry.
@Test
void testProvisionRegistry() {
FleetManagerApi.verifyApiIsSecured();
var alice = new AccountInfo("testProvisionRegistry", "alice", false, 10L);
// verify static deployments config file feature
var deployment = new RegistryDeploymentCreateRest();
deployment.setName("test-deployment");
deployment.setTenantManagerUrl(infra.getTenantManagerUri());
deployment.setRegistryDeploymentUrl("http://registry-test");
FleetManagerApi.verifyCreateDeploymentNotAllowed(deployment, alice);
var registry1 = new RegistryCreate();
registry1.setName("test-registry-1");
var registry1Result = FleetManagerApi.createRegistry(registry1, alice);
assertNotEquals(RegistryStatusValue.failed, registry1Result.getStatus());
Awaitility.await("registry available").atMost(30, TimeUnit.SECONDS).pollInterval(5, TimeUnit.SECONDS).until(() -> {
var reg = FleetManagerApi.getRegistry(registry1Result.getId(), alice);
return reg.getStatus().equals(RegistryStatusValue.ready);
});
Registry registry = FleetManagerApi.getRegistry(registry1Result.getId(), alice);
TenantManagerClient tenantManager = Utils.createTenantManagerClient();
var internalTenant = tenantManager.getTenant(registry.getId());
var resources = internalTenant.getResources();
TenantResource maxTotalSchemas = null;
for (var r : resources) {
if (r.getType() == ResourceType.MAX_TOTAL_SCHEMAS_COUNT) {
maxTotalSchemas = r;
}
}
assertNotNull(maxTotalSchemas);
assertEquals(10, maxTotalSchemas.getLimit());
// TODO e2e test check limits are applied
// Delete
FleetManagerApi.deleteRegistry(registry1Result.getId(), alice);
}
Aggregations