@Test public void setTaskPropertyExceptionTest() throws Exception { DefaultProviderTaskPropertiesAccessor providerTaskPropertiesAccessor = new DefaultProviderTaskPropertiesAccessor(providerTaskPropertiesRepository); try { providerTaskPropertiesAccessor.setTaskProperty(null, "", "", ""); fail(); } catch (AlertDatabaseConstraintException e) { assertNotNull(e); } }
@Override public void setTaskProperty(Long configId, String taskName, String propertyKey, String propertyValue) throws AlertDatabaseConstraintException { if (null == configId || StringUtils.isBlank(taskName) || StringUtils.isBlank(propertyKey) || StringUtils.isBlank(propertyValue)) { throw new AlertDatabaseConstraintException("All fields are required to save a task property"); } ProviderTaskPropertiesEntity taskPropertyToSave = new ProviderTaskPropertiesEntity(configId, taskName, propertyKey, propertyValue); providerTaskPropertiesRepository.save(taskPropertyToSave); }
DefaultProviderTaskPropertiesAccessor implements ProviderTaskPropertiesAccessor { @Override public void setTaskProperty(Long configId, String taskName, String propertyKey, String propertyValue) throws AlertDatabaseConstraintException { if (null == configId || StringUtils.isBlank(taskName) || StringUtils.isBlank(propertyKey) || StringUtils.isBlank(propertyValue)) { throw new AlertDatabaseConstraintException("All fields are required to save a task property"); } ProviderTaskPropertiesEntity taskPropertyToSave = new ProviderTaskPropertiesEntity(configId, taskName, propertyKey, propertyValue); providerTaskPropertiesRepository.save(taskPropertyToSave); } }
DefaultProviderTaskPropertiesAccessor implements ProviderTaskPropertiesAccessor { @Override public void setTaskProperty(Long configId, String taskName, String propertyKey, String propertyValue) throws AlertDatabaseConstraintException { if (null == configId || StringUtils.isBlank(taskName) || StringUtils.isBlank(propertyKey) || StringUtils.isBlank(propertyValue)) { throw new AlertDatabaseConstraintException("All fields are required to save a task property"); } ProviderTaskPropertiesEntity taskPropertyToSave = new ProviderTaskPropertiesEntity(configId, taskName, propertyKey, propertyValue); providerTaskPropertiesRepository.save(taskPropertyToSave); } @Autowired  DefaultProviderTaskPropertiesAccessor(ProviderTaskPropertiesRepository providerTaskPropertiesRepository); }
DefaultProviderTaskPropertiesAccessor implements ProviderTaskPropertiesAccessor { @Override public void setTaskProperty(Long configId, String taskName, String propertyKey, String propertyValue) throws AlertDatabaseConstraintException { if (null == configId || StringUtils.isBlank(taskName) || StringUtils.isBlank(propertyKey) || StringUtils.isBlank(propertyValue)) { throw new AlertDatabaseConstraintException("All fields are required to save a task property"); } ProviderTaskPropertiesEntity taskPropertyToSave = new ProviderTaskPropertiesEntity(configId, taskName, propertyKey, propertyValue); providerTaskPropertiesRepository.save(taskPropertyToSave); } @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 void setTaskProperty(Long configId, String taskName, String propertyKey, String propertyValue) throws AlertDatabaseConstraintException { if (null == configId || StringUtils.isBlank(taskName) || StringUtils.isBlank(propertyKey) || StringUtils.isBlank(propertyValue)) { throw new AlertDatabaseConstraintException("All fields are required to save a task property"); } ProviderTaskPropertiesEntity taskPropertyToSave = new ProviderTaskPropertiesEntity(configId, taskName, propertyKey, propertyValue); providerTaskPropertiesRepository.save(taskPropertyToSave); } @Autowired  DefaultProviderTaskPropertiesAccessor(ProviderTaskPropertiesRepository providerTaskPropertiesRepository); @Override Optional<String> getTaskProperty(String taskName, String propertyKey); @Override void setTaskProperty(Long configId, String taskName, String propertyKey, String propertyValue);  }