@Test(dataProvider = "ServicePropertiesCountProvider") public void testGetFirstServiceBuildProperties(final int SERVICE_PROPERTIES_COUNT) throws Exception { final int NON_SERVICE_PROPERTIES_COUNT = 10; generateResourceContents(SERVICE_PROPERTIES_COUNT, NON_SERVICE_PROPERTIES_COUNT); BuildProperties result = buildPropertiesReader.getFirstServiceBuildProperties(); if(SERVICE_PROPERTIES_COUNT > 0) { Assert.assertNotNull(result); assertAllPropertiesValid(Collections.singletonList(result)); } else { Assert.assertNull(result); } }
public BuildProperties getFirstServiceBuildProperties() { readAllBuildProperties(); for(BuildProperties buildProperties : allBuildProperties) { if(buildProperties.isService()) { return buildProperties; } } return null; }
BuildPropertiesReader { public BuildProperties getFirstServiceBuildProperties() { readAllBuildProperties(); for(BuildProperties buildProperties : allBuildProperties) { if(buildProperties.isService()) { return buildProperties; } } return null; } }
BuildPropertiesReader { public BuildProperties getFirstServiceBuildProperties() { readAllBuildProperties(); for(BuildProperties buildProperties : allBuildProperties) { if(buildProperties.isService()) { return buildProperties; } } return null; } BuildPropertiesReader(String buildPropertiesFile); }
BuildPropertiesReader { public BuildProperties getFirstServiceBuildProperties() { readAllBuildProperties(); for(BuildProperties buildProperties : allBuildProperties) { if(buildProperties.isService()) { return buildProperties; } } return null; } BuildPropertiesReader(String buildPropertiesFile); BuildProperties getFirstServiceBuildProperties(); List<BuildProperties> getNonServiceBuildProperties(); List<BuildProperties> getAllBuildProperties(); void setResourceRetriever(ResourceRetriever resourcesRetriever); }
BuildPropertiesReader { public BuildProperties getFirstServiceBuildProperties() { readAllBuildProperties(); for(BuildProperties buildProperties : allBuildProperties) { if(buildProperties.isService()) { return buildProperties; } } return null; } BuildPropertiesReader(String buildPropertiesFile); BuildProperties getFirstServiceBuildProperties(); List<BuildProperties> getNonServiceBuildProperties(); List<BuildProperties> getAllBuildProperties(); void setResourceRetriever(ResourceRetriever resourcesRetriever);  }