use of tech.aroma.thrift.authentication.AuthenticationToken in project aroma-data-operations by RedRoma.
the class MemoryTokenRepositoryTest method testGetToken.
@Test
public void testGetToken() throws Exception {
assertThrows(() -> repository.getToken(tokenId)).isInstanceOf(InvalidTokenException.class);
repository.saveToken(token);
AuthenticationToken result = repository.getToken(tokenId);
assertThat(result, is(token));
}
use of tech.aroma.thrift.authentication.AuthenticationToken in project aroma-data-operations by RedRoma.
the class MemoryTokenRepositoryTest method testGetTokensBelongingTo.
@Test
public void testGetTokensBelongingTo() throws Exception {
for (AuthenticationToken token : tokens) {
repository.saveToken(token);
}
List<AuthenticationToken> result = repository.getTokensBelongingTo(ownerId);
Set<AuthenticationToken> expected = Sets.newHashSet(tokens);
Set<AuthenticationToken> resultSet = Sets.newHashSet(result);
assertThat(resultSet, is(expected));
}
Aggregations