@Override public List<ApplicationDto> getApplicationsByTenantId(String tenantId) throws ControlServiceException { return applicationService.findAppsByTenantId(tenantId); }
@Test public void testFindAppsByTenantId() { List<ApplicationDto> applications = applicationService.findAppsByTenantId("423421421"); Assert.assertEquals(0, applications.size()); }
@Test public void findAppsByTenantIdTest() { TenantDto tenant = generateTenantDto(); String tenantId = tenant.getId(); ApplicationDto application = generateApplicationDto(tenantId); List<ApplicationDto> applications = applicationService.findAppsByTenantId(tenantId); Assert.assertEquals(1, applications.size()); Assert.assertEquals(application.getId(), applications.get(0).getId()); }
@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()); }