mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 05:09:53 +01:00
Add AuthorManager#getMyAuthorInfo() without transaction
and add test for it
This commit is contained in:
@@ -106,7 +106,6 @@ public class AuthorManagerImplTest extends BrambleMockTestCase {
|
||||
public void testGetAuthorInfoOurselves() throws DbException {
|
||||
Transaction txn = new Transaction(null, true);
|
||||
|
||||
// check ourselves
|
||||
context.checking(new Expectations() {{
|
||||
oneOf(identityManager).getLocalAuthor(txn);
|
||||
will(returnValue(localAuthor));
|
||||
@@ -122,6 +121,22 @@ public class AuthorManagerImplTest extends BrambleMockTestCase {
|
||||
assertEquals(avatarHeader, authorInfo.getAvatarHeader());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testGetMyAuthorInfo() throws DbException {
|
||||
Transaction txn = new Transaction(null, true);
|
||||
|
||||
context.checking(new Expectations() {{
|
||||
oneOf(avatarManager).getMyAvatarHeader(txn);
|
||||
will(returnValue(avatarHeader));
|
||||
}});
|
||||
|
||||
AuthorInfo authorInfo =
|
||||
authorManager.getMyAuthorInfo(txn);
|
||||
assertEquals(OURSELVES, authorInfo.getStatus());
|
||||
assertNull(authorInfo.getAlias());
|
||||
assertEquals(avatarHeader, authorInfo.getAvatarHeader());
|
||||
}
|
||||
|
||||
private void checkAuthorInfoContext(Transaction txn, AuthorId authorId,
|
||||
Collection<Contact> contacts) throws DbException {
|
||||
context.checking(new Expectations() {{
|
||||
|
||||
Reference in New Issue
Block a user