Polishing
Add tests for write and delete. Closes gh-503 Closes gh-511
This commit is contained in:
@@ -30,6 +30,7 @@ import reactor.test.StepVerifier;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.junit.jupiter.SpringExtension;
|
||||
import org.springframework.vault.VaultException;
|
||||
import org.springframework.vault.domain.Person;
|
||||
import org.springframework.vault.support.ObjectMapperSupplier;
|
||||
import org.springframework.vault.util.IntegrationTestSupport;
|
||||
@@ -129,6 +130,13 @@ class ReactiveVaultTemplateGenericIntegrationTests extends IntegrationTestSuppor
|
||||
}).verifyComplete();
|
||||
}
|
||||
|
||||
@Test
|
||||
void listShouldNotReturnAbsentKey() {
|
||||
|
||||
vaultOperations.list("foo").collectList().as(StepVerifier::create)
|
||||
.consumeNextWith(actual -> assertThat(actual).isEmpty()).verifyComplete();
|
||||
}
|
||||
|
||||
@Test
|
||||
void listShouldReturnExistingKey() {
|
||||
|
||||
@@ -167,4 +175,18 @@ class ReactiveVaultTemplateGenericIntegrationTests extends IntegrationTestSuppor
|
||||
|
||||
}).verifyComplete();
|
||||
}
|
||||
|
||||
@Test
|
||||
void deleteUnknownPathShouldFail() {
|
||||
|
||||
vaultOperations.delete("foobar").as(StepVerifier::create)
|
||||
.verifyError(VaultException.class);
|
||||
}
|
||||
|
||||
@Test
|
||||
void writeUnknownPathShouldFail() {
|
||||
|
||||
vaultOperations.write("foobar").as(StepVerifier::create)
|
||||
.verifyError(VaultException.class);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,6 +126,13 @@ class VaultTemplateGenericIntegrationTests extends IntegrationTestSupport {
|
||||
assertThat(keys).contains("mykey");
|
||||
}
|
||||
|
||||
@Test
|
||||
void listShouldNotReturnAbsentKey() {
|
||||
|
||||
List<String> keys = vaultOperations.list("foo");
|
||||
assertThat(keys).isEmpty();
|
||||
}
|
||||
|
||||
@Test
|
||||
void deleteShouldRemoveKey() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user