mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-20 22:59:54 +01:00
Fixed a test, added a regression test.
This commit is contained in:
@@ -157,6 +157,8 @@ public class BlogManagerImplTest extends BriarTestCase {
|
|||||||
context.checking(new Expectations() {{
|
context.checking(new Expectations() {{
|
||||||
oneOf(blogFactory).createBlog(blog2.getAuthor());
|
oneOf(blogFactory).createBlog(blog2.getAuthor());
|
||||||
will(returnValue(blog2));
|
will(returnValue(blog2));
|
||||||
|
oneOf(db).containsGroup(txn, blog2.getId());
|
||||||
|
will(returnValue(true));
|
||||||
oneOf(identityManager).getLocalAuthor(txn);
|
oneOf(identityManager).getLocalAuthor(txn);
|
||||||
will(returnValue(blog1.getAuthor()));
|
will(returnValue(blog1.getAuthor()));
|
||||||
oneOf(db).removeGroup(txn, blog2.getGroup());
|
oneOf(db).removeGroup(txn, blog2.getGroup());
|
||||||
@@ -166,6 +168,25 @@ public class BlogManagerImplTest extends BriarTestCase {
|
|||||||
context.assertIsSatisfied();
|
context.assertIsSatisfied();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testRemovingContactAfterRemovingBlog() throws DbException {
|
||||||
|
final Transaction txn = new Transaction(null, false);
|
||||||
|
|
||||||
|
final ContactId contactId = new ContactId(0);
|
||||||
|
Contact contact = new Contact(contactId, blog2.getAuthor(),
|
||||||
|
blog1.getAuthor().getId(), true, true);
|
||||||
|
|
||||||
|
context.checking(new Expectations() {{
|
||||||
|
oneOf(blogFactory).createBlog(blog2.getAuthor());
|
||||||
|
will(returnValue(blog2));
|
||||||
|
oneOf(db).containsGroup(txn, blog2.getId());
|
||||||
|
will(returnValue(false));
|
||||||
|
}});
|
||||||
|
|
||||||
|
blogManager.removingContact(txn, contact);
|
||||||
|
context.assertIsSatisfied();
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void testIncomingMessage() throws DbException, FormatException {
|
public void testIncomingMessage() throws DbException, FormatException {
|
||||||
final Transaction txn = new Transaction(null, false);
|
final Transaction txn = new Transaction(null, false);
|
||||||
|
|||||||
Reference in New Issue
Block a user