@Test public void getTaskPropertyTest() { DefaultProviderTaskPropertiesAccessor providerTaskPropertiesAccessor = new DefaultProviderTaskPropertiesAccessor(providerTaskPropertiesRepository); Optional<String> taskPropertyValue = providerTaskPropertiesAccessor.getTaskProperty(taskName, propertyName); assertTrue(taskPropertyValue.isPresent()); assertEquals(value, taskPropertyValue.get()); }
@Override public Optional<String> getTaskProperty(String taskName, String propertyKey) { if (StringUtils.isBlank(taskName) || StringUtils.isBlank(propertyKey)) { return Optional.empty(); } return providerTaskPropertiesRepository.findByTaskNameAndPropertyName(taskName, propertyKey).map(ProviderTaskPropertiesEntity::getValue); }
DefaultProviderTaskPropertiesAccessor implements ProviderTaskPropertiesAccessor { @Override public Optional<String> getTaskProperty(String taskName, String propertyKey) { if (StringUtils.isBlank(taskName) || StringUtils.isBlank(propertyKey)) { return Optional.empty(); } return providerTaskPropertiesRepository.findByTaskNameAndPropertyName(taskName, propertyKey).map(ProviderTaskPropertiesEntity::getValue); } }
DefaultProviderTaskPropertiesAccessor implements ProviderTaskPropertiesAccessor { @Override public Optional<String> getTaskProperty(String taskName, String propertyKey) { if (StringUtils.isBlank(taskName) || StringUtils.isBlank(propertyKey)) { return Optional.empty(); } return providerTaskPropertiesRepository.findByTaskNameAndPropertyName(taskName, propertyKey).map(ProviderTaskPropertiesEntity::getValue); } @Autowired  DefaultProviderTaskPropertiesAccessor(ProviderTaskPropertiesRepository providerTaskPropertiesRepository); }
DefaultProviderTaskPropertiesAccessor implements ProviderTaskPropertiesAccessor { @Override public Optional<String> getTaskProperty(String taskName, String propertyKey) { if (StringUtils.isBlank(taskName) || StringUtils.isBlank(propertyKey)) { return Optional.empty(); } return providerTaskPropertiesRepository.findByTaskNameAndPropertyName(taskName, propertyKey).map(ProviderTaskPropertiesEntity::getValue); } @Autowired  DefaultProviderTaskPropertiesAccessor(ProviderTaskPropertiesRepository providerTaskPropertiesRepository); @Override Optional<String> getTaskProperty(String taskName, String propertyKey); @Override void setTaskProperty(Long configId, String taskName, String propertyKey, String propertyValue); }
DefaultProviderTaskPropertiesAccessor implements ProviderTaskPropertiesAccessor { @Override public Optional<String> getTaskProperty(String taskName, String propertyKey) { if (StringUtils.isBlank(taskName) || StringUtils.isBlank(propertyKey)) { return Optional.empty(); } return providerTaskPropertiesRepository.findByTaskNameAndPropertyName(taskName, propertyKey).map(ProviderTaskPropertiesEntity::getValue); } @Autowired  DefaultProviderTaskPropertiesAccessor(ProviderTaskPropertiesRepository providerTaskPropertiesRepository); @Override Optional<String> getTaskProperty(String taskName, String propertyKey); @Override void setTaskProperty(Long configId, String taskName, String propertyKey, String propertyValue);  }