Fixed a test, added a regression test.

This commit is contained in:
akwizgran
2017-06-30 12:58:44 +01:00
parent 05af21e8dc
commit 79aafcda69

View File

@@ -157,6 +157,8 @@ public class BlogManagerImplTest extends BriarTestCase {
context.checking(new Expectations() {{
oneOf(blogFactory).createBlog(blog2.getAuthor());
will(returnValue(blog2));
oneOf(db).containsGroup(txn, blog2.getId());
will(returnValue(true));
oneOf(identityManager).getLocalAuthor(txn);
will(returnValue(blog1.getAuthor()));
oneOf(db).removeGroup(txn, blog2.getGroup());
@@ -166,6 +168,25 @@ public class BlogManagerImplTest extends BriarTestCase {
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
public void testIncomingMessage() throws DbException, FormatException {
final Transaction txn = new Transaction(null, false);