@Test public void should_read_simple_secrets_definition() throws FileNotFoundException, VaultException { final DataLoader dataLoader = new DataLoader(vaultConnection); dataLoader.load(new FileInputStream("src/test/resources/only_secrets.yml")); final Map<String, Object> fooSecret = new HashMap<>(); fooSecret.put("zip", "zap"); fooSecret.put("a", "b"); final Map<String, Object> barSecret = new HashMap<>(); barSecret.put("zap", "zip"); barSecret.put("b", "a"); verify(vaultConnection).writeLogical("secret/foo", fooSecret); verify(vaultConnection).writeLogical("secret/bar", barSecret); }
public void load(InputStream inputStream) { final Yaml yaml = new Yaml(); final Object load = yaml.load(inputStream); if (areOnlySecrets(load)) { final List<Map<String, Map<String, Object>>> secrets = (List) load; insertTokens(secrets); insertSecrets(secrets); } }
DataLoader { public void load(InputStream inputStream) { final Yaml yaml = new Yaml(); final Object load = yaml.load(inputStream); if (areOnlySecrets(load)) { final List<Map<String, Map<String, Object>>> secrets = (List) load; insertTokens(secrets); insertSecrets(secrets); } } }
DataLoader { public void load(InputStream inputStream) { final Yaml yaml = new Yaml(); final Object load = yaml.load(inputStream); if (areOnlySecrets(load)) { final List<Map<String, Map<String, Object>>> secrets = (List) load; insertTokens(secrets); insertSecrets(secrets); } } DataLoader(VaultConnection vault); }
DataLoader { public void load(InputStream inputStream) { final Yaml yaml = new Yaml(); final Object load = yaml.load(inputStream); if (areOnlySecrets(load)) { final List<Map<String, Map<String, Object>>> secrets = (List) load; insertTokens(secrets); insertSecrets(secrets); } } DataLoader(VaultConnection vault); void load(InputStream inputStream); }
DataLoader { public void load(InputStream inputStream) { final Yaml yaml = new Yaml(); final Object load = yaml.load(inputStream); if (areOnlySecrets(load)) { final List<Map<String, Map<String, Object>>> secrets = (List) load; insertTokens(secrets); insertSecrets(secrets); } } DataLoader(VaultConnection vault); void load(InputStream inputStream);  }