@Test(expected = FormatException.class) public void testRejectsMemberJoinWithInvalidMemberSignature() throws Exception { expectMemberJoinMessage(true, false); BdfList body = BdfList.of(JOIN.getInt(), memberList, invite, memberSignature); validator.validateMessage(message, group, body); }
@Override protected BdfMessageContext validateMessage(Message m, Group g, BdfList body) throws InvalidMessageException, FormatException { checkSize(body, 4, 6); int type = body.getLong(0).intValue(); BdfList memberList = body.getList(1); Author member = clientHelper.parseAndValidateAuthor(memberList); BdfMessageContext c; if (type == JOIN.getInt()) { c = validateJoin(m, g, body, member); addMessageMetadata(c, memberList, m.getTimestamp()); } else if (type == POST.getInt()) { c = validatePost(m, g, body, member); addMessageMetadata(c, memberList, m.getTimestamp()); } else { throw new InvalidMessageException("Unknown Message Type"); } c.getDictionary().put(KEY_TYPE, type); return c; }
GroupMessageValidator extends BdfMessageValidator { @Override protected BdfMessageContext validateMessage(Message m, Group g, BdfList body) throws InvalidMessageException, FormatException { checkSize(body, 4, 6); int type = body.getLong(0).intValue(); BdfList memberList = body.getList(1); Author member = clientHelper.parseAndValidateAuthor(memberList); BdfMessageContext c; if (type == JOIN.getInt()) { c = validateJoin(m, g, body, member); addMessageMetadata(c, memberList, m.getTimestamp()); } else if (type == POST.getInt()) { c = validatePost(m, g, body, member); addMessageMetadata(c, memberList, m.getTimestamp()); } else { throw new InvalidMessageException("Unknown Message Type"); } c.getDictionary().put(KEY_TYPE, type); return c; } }
GroupMessageValidator extends BdfMessageValidator { @Override protected BdfMessageContext validateMessage(Message m, Group g, BdfList body) throws InvalidMessageException, FormatException { checkSize(body, 4, 6); int type = body.getLong(0).intValue(); BdfList memberList = body.getList(1); Author member = clientHelper.parseAndValidateAuthor(memberList); BdfMessageContext c; if (type == JOIN.getInt()) { c = validateJoin(m, g, body, member); addMessageMetadata(c, memberList, m.getTimestamp()); } else if (type == POST.getInt()) { c = validatePost(m, g, body, member); addMessageMetadata(c, memberList, m.getTimestamp()); } else { throw new InvalidMessageException("Unknown Message Type"); } c.getDictionary().put(KEY_TYPE, type); return c; } GroupMessageValidator(PrivateGroupFactory privateGroupFactory,
			ClientHelper clientHelper, MetadataEncoder metadataEncoder,
			Clock clock, GroupInvitationFactory groupInvitationFactory); }
GroupMessageValidator extends BdfMessageValidator { @Override protected BdfMessageContext validateMessage(Message m, Group g, BdfList body) throws InvalidMessageException, FormatException { checkSize(body, 4, 6); int type = body.getLong(0).intValue(); BdfList memberList = body.getList(1); Author member = clientHelper.parseAndValidateAuthor(memberList); BdfMessageContext c; if (type == JOIN.getInt()) { c = validateJoin(m, g, body, member); addMessageMetadata(c, memberList, m.getTimestamp()); } else if (type == POST.getInt()) { c = validatePost(m, g, body, member); addMessageMetadata(c, memberList, m.getTimestamp()); } else { throw new InvalidMessageException("Unknown Message Type"); } c.getDictionary().put(KEY_TYPE, type); return c; } GroupMessageValidator(PrivateGroupFactory privateGroupFactory,
			ClientHelper clientHelper, MetadataEncoder metadataEncoder,
			Clock clock, GroupInvitationFactory groupInvitationFactory);  }
GroupMessageValidator extends BdfMessageValidator { @Override protected BdfMessageContext validateMessage(Message m, Group g, BdfList body) throws InvalidMessageException, FormatException { checkSize(body, 4, 6); int type = body.getLong(0).intValue(); BdfList memberList = body.getList(1); Author member = clientHelper.parseAndValidateAuthor(memberList); BdfMessageContext c; if (type == JOIN.getInt()) { c = validateJoin(m, g, body, member); addMessageMetadata(c, memberList, m.getTimestamp()); } else if (type == POST.getInt()) { c = validatePost(m, g, body, member); addMessageMetadata(c, memberList, m.getTimestamp()); } else { throw new InvalidMessageException("Unknown Message Type"); } c.getDictionary().put(KEY_TYPE, type); return c; } GroupMessageValidator(PrivateGroupFactory privateGroupFactory,
			ClientHelper clientHelper, MetadataEncoder metadataEncoder,
			Clock clock, GroupInvitationFactory groupInvitationFactory);   }