@Test public void getComputedProperties() { final TitleImpl title1 = new TitleImpl(); final TitleImpl title2 = new TitleImpl(); final TitleImpl title3 = new TitleImpl(); final FileSizeImpl fileSize = new FileSizeImpl(); final ComputedProperties computedProperties = new ComputedPropertiesImpl(); ctx.registerInjectActivateService(computedProperties); ctx.registerInjectActivateService(title1, Constants.SERVICE_RANKING, "0"); ctx.registerInjectActivateService(title2, Constants.SERVICE_RANKING, "200"); ctx.registerInjectActivateService(title3, Constants.SERVICE_RANKING, "100"); ctx.registerInjectActivateService(fileSize, Constants.SERVICE_RANKING, "1000"); List<ComputedProperty> actual = computedProperties.getComputedProperties(); assertEquals(2, actual.size()); assertEquals(actual.get(0), fileSize); assertEquals(actual.get(1), title2); }
public List<ComputedProperty> getComputedProperties() { if (log.isDebugEnabled()) { log.debug("Returning this list of highest ranking Computed Prooerties by label"); rankedComputedProperties.stream().forEach(computedProperty -> { log.debug("Computed property: [ name: {} ] - [ label: {} ]", computedProperty.getName(), computedProperty.getLabel()); }); } return new ArrayList<>(rankedComputedProperties); }
ComputedPropertiesImpl implements ComputedProperties { public List<ComputedProperty> getComputedProperties() { if (log.isDebugEnabled()) { log.debug("Returning this list of highest ranking Computed Prooerties by label"); rankedComputedProperties.stream().forEach(computedProperty -> { log.debug("Computed property: [ name: {} ] - [ label: {} ]", computedProperty.getName(), computedProperty.getLabel()); }); } return new ArrayList<>(rankedComputedProperties); } }
ComputedPropertiesImpl implements ComputedProperties { public List<ComputedProperty> getComputedProperties() { if (log.isDebugEnabled()) { log.debug("Returning this list of highest ranking Computed Prooerties by label"); rankedComputedProperties.stream().forEach(computedProperty -> { log.debug("Computed property: [ name: {} ] - [ label: {} ]", computedProperty.getName(), computedProperty.getLabel()); }); } return new ArrayList<>(rankedComputedProperties); }  }
ComputedPropertiesImpl implements ComputedProperties { public List<ComputedProperty> getComputedProperties() { if (log.isDebugEnabled()) { log.debug("Returning this list of highest ranking Computed Prooerties by label"); rankedComputedProperties.stream().forEach(computedProperty -> { log.debug("Computed property: [ name: {} ] - [ label: {} ]", computedProperty.getName(), computedProperty.getLabel()); }); } return new ArrayList<>(rankedComputedProperties); }  List<ComputedProperty> getComputedProperties(); }
ComputedPropertiesImpl implements ComputedProperties { public List<ComputedProperty> getComputedProperties() { if (log.isDebugEnabled()) { log.debug("Returning this list of highest ranking Computed Prooerties by label"); rankedComputedProperties.stream().forEach(computedProperty -> { log.debug("Computed property: [ name: {} ] - [ label: {} ]", computedProperty.getName(), computedProperty.getLabel()); }); } return new ArrayList<>(rankedComputedProperties); }  List<ComputedProperty> getComputedProperties();  }