@Override public List<ServerProfileSchemaDto> getServerProfileSchemasByApplicationId( String applicationId) throws ControlServiceException { return serverProfileService.findServerProfileSchemasByAppId(applicationId); }
String appId = group.getApplicationId(); List<ServerProfileSchemaDto> serverSchemas = serverProfileService .findServerProfileSchemasByAppId(appId); Collections.sort(serverSchemas); List<EndpointProfileSchemaDto> endpointProfileSchemas = findProfileSchemasByAppId(appId);
@Test public void testFindServerProfileSchemasByAppId() { ApplicationDto app = generateApplicationDto(); List<ServerProfileSchemaDto> found = serverProfileService.findServerProfileSchemasByAppId(app.getId()); Assert.assertEquals(1, found.size()); generateServerProfileSchema(null, null); generateServerProfileSchema(null, null); generateServerProfileSchema(null, null); generateServerProfileSchema(null, null); List<ServerProfileSchemaDto> expected = new ArrayList<>(); expected.add(found.get(0)); expected.add(generateServerProfileSchema(app.getId(), app.getTenantId())); expected.add(generateServerProfileSchema(app.getId(), app.getTenantId())); expected.add(generateServerProfileSchema(app.getId(), app.getTenantId())); expected.add(generateServerProfileSchema(app.getId(), app.getTenantId())); found = serverProfileService.findServerProfileSchemasByAppId(app.getId()); Assert.assertEquals(expected, found); }
: serverProfileService.findServerProfileSchemasByAppId(appDto.getId())) { LOG.debug("Processing version {}", version); cacheService.resetFilters(new AppProfileVersionsKey(
@Test public void testRemoveServerProfileSchemaByAppId() { ApplicationDto app = generateApplicationDto(); generateServerProfileSchema(null, null); generateServerProfileSchema(null, null); generateServerProfileSchema(null, null); generateServerProfileSchema(null, null); generateServerProfileSchema(app.getId(), app.getTenantId()); generateServerProfileSchema(app.getId(), app.getTenantId()); generateServerProfileSchema(app.getId(), app.getTenantId()); generateServerProfileSchema(app.getId(), app.getTenantId()); serverProfileService.removeServerProfileSchemaByAppId(app.getId()); List<ServerProfileSchemaDto> found = serverProfileService.findServerProfileSchemasByAppId(app.getId()); Assert.assertTrue(found.isEmpty()); }