use of com.amihaiemil.eoyaml.Scalar in project artipie by artipie.
the class UsersFromStorageYamlTest method readsCredentialsFromCache.
@Test
void readsCredentialsFromCache() {
final CachedCreds cache = new CachedCreds();
new TestResource("_credentials.yaml").saveTo(this.storage, this.key);
final UsersFromStorageYaml creds = new UsersFromStorageYaml(this.storage, this.key, cache);
creds.yaml().toCompletableFuture().join();
this.saveCreds(Users.PasswordFormat.PLAIN, Pair.of(new Users.User("pol"), "newpswd"));
MatcherAssert.assertThat(creds.yaml().toCompletableFuture().join().yamlMapping("credentials").keys().stream().map(YamlNode::asScalar).map(Scalar::value).toList(), Matchers.containsInAnyOrder("bob", "alice"));
}
Aggregations