use of keywhiz.api.model.SanitizedSecretWithGroups in project keywhiz by square.
the class SecretControllerTest method assertListContainsSecretsWithIds.
private void assertListContainsSecretsWithIds(List<SanitizedSecretWithGroups> secrets, List<Long> ids) {
List<Long> foundIds = new ArrayList<>();
for (SanitizedSecretWithGroups secretWithGroups : secrets) {
if (ids.contains(secretWithGroups.secret().id())) {
foundIds.add(secretWithGroups.secret().id());
}
}
assertThat(foundIds).as("List should contain secrets with IDs %s; found IDs %s in secret list %s", ids, foundIds, secrets).containsExactlyElementsOf(ids);
}
use of keywhiz.api.model.SanitizedSecretWithGroups in project keywhiz by square.
the class SecretControllerTest method assertListDoesNotContainSecretsWithIds.
private void assertListDoesNotContainSecretsWithIds(List<SanitizedSecretWithGroups> secrets, List<Long> ids) {
Set<Long> foundIds = new HashSet<>();
for (SanitizedSecretWithGroups secretWithGroups : secrets) {
if (ids.contains(secretWithGroups.secret().id())) {
foundIds.add(secretWithGroups.secret().id());
}
}
assertThat(foundIds).as("List should NOT contain secrets with IDs %s; found IDs %s in secret list %s", ids, foundIds, secrets).isEmpty();
}
Aggregations