DynamoJobMetaRepository extends AbstractDynamoRepository implements JobMetaRepository { @Override public String setValue(String jobType, String key, String value) { putIfAbsent(jobType); return putValue(jobType, key, value); } DynamoJobMetaRepository(final DynamoDbClient dynamoDbClient, final String tableName); @Override JobMeta getJobMeta(String jobType); @Override boolean createValue(String jobType, String key, String value); @Override boolean setRunningJob(String jobType, String jobId); @Override String getRunningJob(String jobType); @Override void clearRunningJob(String jobType); @Override void disable(String jobType, String comment); @Override void enable(String jobType); @Override String setValue(String jobType, String key, String value); @Override String getValue(String jobType, String key); @Override Set<String> findAllJobTypes(); @Override void deleteAll();  }
@Test public void shouldReturnPreviousValueOnSetValue() { dynamoJobMetaRepository.setValue("myJobType", "someKey", "someOldValue"); String previousValue = dynamoJobMetaRepository.setValue("myJobType", "someKey", "someNewValue"); assertThat(previousValue, is("someOldValue")); }