@Override public String compute(ConfigurationIdKey key) { LOG.debug("Fetching result for getConfIdByKey"); String confId = null; List<ConfigurationDto> configurations = configurationService.findConfigurationsByEndpointGroupId(key.getEndpointGroupId()); for (ConfigurationDto confDto : configurations) { if (confDto.getSchemaVersion() == key.getConfigSchemaVersion()) { confId = confDto.getId(); break; } } return confId; } });
@Test public void findConfigurationsByEndpointGroupIdTest() { EndpointGroupDto group = generateEndpointGroupDto(null); List<ConfigurationDto> configurations = generateConfigurationDto(null, group.getId(), 1, true, false); List<ConfigurationDto> dtoList = configurationService.findConfigurationsByEndpointGroupId(group.getId()); Assert.assertNotNull(dtoList); Assert.assertEquals(configurations, dtoList); }