mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 13:19:52 +01:00
Don't accept incoming messages in our own avatar group
This commit is contained in:
@@ -180,6 +180,7 @@ public class AvatarManagerImplTest extends BrambleMockTestCase {
|
||||
new BdfEntry(MSG_KEY_CONTENT_TYPE, contentType)
|
||||
);
|
||||
|
||||
expectGetOurGroup(txn);
|
||||
context.checking(new Expectations() {{
|
||||
oneOf(metadataParser).parse(meta);
|
||||
will(returnValue(d));
|
||||
@@ -211,6 +212,7 @@ public class AvatarManagerImplTest extends BrambleMockTestCase {
|
||||
new BdfEntry(MSG_KEY_CONTENT_TYPE, contentType)
|
||||
);
|
||||
|
||||
expectGetOurGroup(txn);
|
||||
context.checking(new Expectations() {{
|
||||
oneOf(metadataParser).parse(meta);
|
||||
will(returnValue(d));
|
||||
@@ -241,6 +243,7 @@ public class AvatarManagerImplTest extends BrambleMockTestCase {
|
||||
new BdfEntry(MSG_KEY_CONTENT_TYPE, contentType)
|
||||
);
|
||||
|
||||
expectGetOurGroup(txn);
|
||||
context.checking(new Expectations() {{
|
||||
oneOf(metadataParser).parse(meta);
|
||||
will(returnValue(d));
|
||||
@@ -256,6 +259,14 @@ public class AvatarManagerImplTest extends BrambleMockTestCase {
|
||||
assertEquals(0, txn.getActions().size());
|
||||
}
|
||||
|
||||
@Test(expected = InvalidMessageException.class)
|
||||
public void testIncomingMessageInOwnGroup()
|
||||
throws DbException, InvalidMessageException, FormatException {
|
||||
Transaction txn = new Transaction(null, false);
|
||||
expectGetOurGroup(txn);
|
||||
avatarManager.incomingMessage(txn, ourMsg, meta);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testAddAvatar() throws Exception {
|
||||
byte[] avatarBytes = getRandomBytes(42);
|
||||
|
||||
Reference in New Issue
Block a user