@Test public void propertyInOrganizationEmptySeries() throws NotFoundException { assertEquals(ORG_PROPERTY_VALUE, presetProviderImpl.getProperty("", ORG_PROPERTY_NAME)); }
@Override public String getProperty(String seriesID, String propertyName) throws NotFoundException { String propertyValue = ""; if (StringUtils.trimToNull(seriesID) != null) { try { propertyValue = seriesService.getSeriesProperty(seriesID, propertyName); } catch (NotFoundException e) { logger.debug("The property {} was not found in the series {} so we will try to find it in the organization.", propertyName, seriesID); } catch (Exception e) { logger.warn( "Unable to get the property {} from the series {} so we will try to find it in the organization. The exception was ", propertyName, seriesID, e); } } if (StringUtils.isBlank(propertyValue)) { propertyValue = securityService.getOrganization().getProperties().get(propertyName); if (StringUtils.isBlank(propertyValue)) { throw new NotFoundException("Unable to find the property in either the series or organization"); } } return propertyValue; }
PresetProviderImpl implements PresetProvider { @Override public String getProperty(String seriesID, String propertyName) throws NotFoundException { String propertyValue = ""; if (StringUtils.trimToNull(seriesID) != null) { try { propertyValue = seriesService.getSeriesProperty(seriesID, propertyName); } catch (NotFoundException e) { logger.debug("The property {} was not found in the series {} so we will try to find it in the organization.", propertyName, seriesID); } catch (Exception e) { logger.warn( "Unable to get the property {} from the series {} so we will try to find it in the organization. The exception was ", propertyName, seriesID, e); } } if (StringUtils.isBlank(propertyValue)) { propertyValue = securityService.getOrganization().getProperties().get(propertyName); if (StringUtils.isBlank(propertyValue)) { throw new NotFoundException("Unable to find the property in either the series or organization"); } } return propertyValue; } }
PresetProviderImpl implements PresetProvider { @Override public String getProperty(String seriesID, String propertyName) throws NotFoundException { String propertyValue = ""; if (StringUtils.trimToNull(seriesID) != null) { try { propertyValue = seriesService.getSeriesProperty(seriesID, propertyName); } catch (NotFoundException e) { logger.debug("The property {} was not found in the series {} so we will try to find it in the organization.", propertyName, seriesID); } catch (Exception e) { logger.warn( "Unable to get the property {} from the series {} so we will try to find it in the organization. The exception was ", propertyName, seriesID, e); } } if (StringUtils.isBlank(propertyValue)) { propertyValue = securityService.getOrganization().getProperties().get(propertyName); if (StringUtils.isBlank(propertyValue)) { throw new NotFoundException("Unable to find the property in either the series or organization"); } } return propertyValue; }  }
PresetProviderImpl implements PresetProvider { @Override public String getProperty(String seriesID, String propertyName) throws NotFoundException { String propertyValue = ""; if (StringUtils.trimToNull(seriesID) != null) { try { propertyValue = seriesService.getSeriesProperty(seriesID, propertyName); } catch (NotFoundException e) { logger.debug("The property {} was not found in the series {} so we will try to find it in the organization.", propertyName, seriesID); } catch (Exception e) { logger.warn( "Unable to get the property {} from the series {} so we will try to find it in the organization. The exception was ", propertyName, seriesID, e); } } if (StringUtils.isBlank(propertyValue)) { propertyValue = securityService.getOrganization().getProperties().get(propertyName); if (StringUtils.isBlank(propertyValue)) { throw new NotFoundException("Unable to find the property in either the series or organization"); } } return propertyValue; }  void setSeriesService(SeriesService seriesService); void setSecurityService(SecurityService securityService); @Override String getProperty(String seriesID, String propertyName); }
PresetProviderImpl implements PresetProvider { @Override public String getProperty(String seriesID, String propertyName) throws NotFoundException { String propertyValue = ""; if (StringUtils.trimToNull(seriesID) != null) { try { propertyValue = seriesService.getSeriesProperty(seriesID, propertyName); } catch (NotFoundException e) { logger.debug("The property {} was not found in the series {} so we will try to find it in the organization.", propertyName, seriesID); } catch (Exception e) { logger.warn( "Unable to get the property {} from the series {} so we will try to find it in the organization. The exception was ", propertyName, seriesID, e); } } if (StringUtils.isBlank(propertyValue)) { propertyValue = securityService.getOrganization().getProperties().get(propertyName); if (StringUtils.isBlank(propertyValue)) { throw new NotFoundException("Unable to find the property in either the series or organization"); } } return propertyValue; }  void setSeriesService(SeriesService seriesService); void setSecurityService(SecurityService securityService); @Override String getProperty(String seriesID, String propertyName);  }