@Override public List<ConfigurationSchemaDto> getConfigurationSchemasByApplicationId( String applicationId) throws ControlServiceException { return configurationService.findConfSchemasByAppId(applicationId); }
@Test public void removeConfSchemasByAppIdTest() { ApplicationDto application = generateApplicationDto(); String appId = application.getId(); List<ConfigurationSchemaDto> dtoList = configurationService.findConfSchemasByAppId(appId); Assert.assertNotNull(dtoList); Assert.assertFalse(dtoList.isEmpty()); configurationService.removeConfSchemasByAppId(appId); dtoList = configurationService.findConfSchemasByAppId(appId); Assert.assertNotNull(dtoList); Assert.assertTrue(dtoList.isEmpty()); }
@Test public void testRemoveAppsByTenantId() { TenantDto tenant = generateTenantDto(); ApplicationDto application = generateApplicationDto(tenant.getId()); applicationService.removeAppsByTenantId(tenant.getId()); List<ApplicationDto> foundApplications = applicationService.findAppsByTenantId(tenant.getId()); Assert.assertTrue(foundApplications.isEmpty()); Assert.assertEquals(0, foundApplications.size()); TenantDto foundTenant = userService.findTenantById(tenant.getId()); Assert.assertNotNull(foundTenant); List<EndpointProfileSchemaDto> foundProfileSchemas = profileService.findProfileSchemasByAppId(application.getId()); Assert.assertEquals(0, foundProfileSchemas.size()); List<ConfigurationSchemaDto> foundConfigSchemas = configurationService.findConfSchemasByAppId(application.getId()); Assert.assertEquals(0, foundConfigSchemas.size()); }