@Test public void testGetNull() { when(template.read(anyString())).thenReturn(null); Assert.assertNull(underTest.get(gson.toJson(secret))); }
@Override @Cacheable(cacheNames = "vaultCache") public String get(@NotNull String secret) { return Optional.ofNullable(convertToVaultSecret(secret)).map(s -> { VaultResponse response = template.read(s.getPath()); return response != null && response.getData() != null ? String.valueOf(response.getData().get("secret")) : null; }).orElse(null); }
VaultKvV1Engine extends AbstractVaultEngine<VaultKvV1Engine> { @Override @Cacheable(cacheNames = "vaultCache") public String get(@NotNull String secret) { return Optional.ofNullable(convertToVaultSecret(secret)).map(s -> { VaultResponse response = template.read(s.getPath()); return response != null && response.getData() != null ? String.valueOf(response.getData().get("secret")) : null; }).orElse(null); } }
VaultKvV1Engine extends AbstractVaultEngine<VaultKvV1Engine> { @Override @Cacheable(cacheNames = "vaultCache") public String get(@NotNull String secret) { return Optional.ofNullable(convertToVaultSecret(secret)).map(s -> { VaultResponse response = template.read(s.getPath()); return response != null && response.getData() != null ? String.valueOf(response.getData().get("secret")) : null; }).orElse(null); } @Inject  VaultKvV1Engine(VaultTemplate template); }
VaultKvV1Engine extends AbstractVaultEngine<VaultKvV1Engine> { @Override @Cacheable(cacheNames = "vaultCache") public String get(@NotNull String secret) { return Optional.ofNullable(convertToVaultSecret(secret)).map(s -> { VaultResponse response = template.read(s.getPath()); return response != null && response.getData() != null ? String.valueOf(response.getData().get("secret")) : null; }).orElse(null); } @Inject  VaultKvV1Engine(VaultTemplate template); @Override String put(String path, String value); @Override boolean isExists(String secret); @Override @Cacheable(cacheNames = "vaultCache") String get(@NotNull String secret); @Override @CacheEvict(cacheNames = "vaultCache", allEntries = true) void delete(String secret); @Override SecretResponse convertToExternal(String secret); List<String> listEntries(String path); void cleanup(String path); }
VaultKvV1Engine extends AbstractVaultEngine<VaultKvV1Engine> { @Override @Cacheable(cacheNames = "vaultCache") public String get(@NotNull String secret) { return Optional.ofNullable(convertToVaultSecret(secret)).map(s -> { VaultResponse response = template.read(s.getPath()); return response != null && response.getData() != null ? String.valueOf(response.getData().get("secret")) : null; }).orElse(null); } @Inject  VaultKvV1Engine(VaultTemplate template); @Override String put(String path, String value); @Override boolean isExists(String secret); @Override @Cacheable(cacheNames = "vaultCache") String get(@NotNull String secret); @Override @CacheEvict(cacheNames = "vaultCache", allEntries = true) void delete(String secret); @Override SecretResponse convertToExternal(String secret); List<String> listEntries(String path); void cleanup(String path);  }