@Test(expected = NoSqlAssertionError.class) public void should_fail_if_secrets_not_the_same() throws FileNotFoundException, VaultException { final Map<String, String> fooSecret = new HashMap<>(); fooSecret.put("zip", "zap"); fooSecret.put("a", "b"); final Map<String, String> barSecret = new HashMap<>(); barSecret.put("zip", "zip"); barSecret.put("b", "a"); when(vaultConnection.readLogical("secret/foo")).thenReturn(fooSecret); when(vaultConnection.readLogical("secret/bar")).thenReturn(barSecret); VaultAssertion.strictAssertEquals(new FileInputStream("src/test/resources/only_secrets.yml"), vaultConnection); }
public static void strictAssertEquals(final InputStream dataset, final VaultConnection vault) { final Yaml yaml = new Yaml(); final Object load = yaml.load(dataset); if (areOnlySecrets(load)) { final List<Map<String, Map<String, Object>>> secrets = (List) load; checkSecretsRegisteredByTokens(secrets, vault); assertSecrets(secrets, vault); } }
VaultAssertion { public static void strictAssertEquals(final InputStream dataset, final VaultConnection vault) { final Yaml yaml = new Yaml(); final Object load = yaml.load(dataset); if (areOnlySecrets(load)) { final List<Map<String, Map<String, Object>>> secrets = (List) load; checkSecretsRegisteredByTokens(secrets, vault); assertSecrets(secrets, vault); } } }
VaultAssertion { public static void strictAssertEquals(final InputStream dataset, final VaultConnection vault) { final Yaml yaml = new Yaml(); final Object load = yaml.load(dataset); if (areOnlySecrets(load)) { final List<Map<String, Map<String, Object>>> secrets = (List) load; checkSecretsRegisteredByTokens(secrets, vault); assertSecrets(secrets, vault); } }  }
VaultAssertion { public static void strictAssertEquals(final InputStream dataset, final VaultConnection vault) { final Yaml yaml = new Yaml(); final Object load = yaml.load(dataset); if (areOnlySecrets(load)) { final List<Map<String, Map<String, Object>>> secrets = (List) load; checkSecretsRegisteredByTokens(secrets, vault); assertSecrets(secrets, vault); } }  static void strictAssertEquals(final InputStream dataset, final VaultConnection vault); }
VaultAssertion { public static void strictAssertEquals(final InputStream dataset, final VaultConnection vault) { final Yaml yaml = new Yaml(); final Object load = yaml.load(dataset); if (areOnlySecrets(load)) { final List<Map<String, Map<String, Object>>> secrets = (List) load; checkSecretsRegisteredByTokens(secrets, vault); assertSecrets(secrets, vault); } }  static void strictAssertEquals(final InputStream dataset, final VaultConnection vault);  }