@Test(expected = FormatException.class) public void testValidateBlogPostWithoutSignature() throws IOException, GeneralSecurityException { BdfList content = BdfList.of(null, null, body, null); BdfList m = BdfList.of(POST.getInt(), content, null); validator.validateMessage(message, group, m); }
@Override protected BdfMessageContext validateMessage(Message m, Group g, BdfList body) throws InvalidMessageException, FormatException { BdfMessageContext c; int type = body.getLong(0).intValue(); body.remove(0); switch (MessageType.valueOf(type)) { case POST: c = validatePost(m, g, body); addMessageMetadata(c, m.getTimestamp()); break; case COMMENT: c = validateComment(m, g, body); addMessageMetadata(c, m.getTimestamp()); break; case WRAPPED_POST: c = validateWrappedPost(body); break; case WRAPPED_COMMENT: c = validateWrappedComment(body); break; default: throw new InvalidMessageException("Unknown Message Type"); } c.getDictionary().put(KEY_TYPE, type); return c; }
BlogPostValidator extends BdfMessageValidator { @Override protected BdfMessageContext validateMessage(Message m, Group g, BdfList body) throws InvalidMessageException, FormatException { BdfMessageContext c; int type = body.getLong(0).intValue(); body.remove(0); switch (MessageType.valueOf(type)) { case POST: c = validatePost(m, g, body); addMessageMetadata(c, m.getTimestamp()); break; case COMMENT: c = validateComment(m, g, body); addMessageMetadata(c, m.getTimestamp()); break; case WRAPPED_POST: c = validateWrappedPost(body); break; case WRAPPED_COMMENT: c = validateWrappedComment(body); break; default: throw new InvalidMessageException("Unknown Message Type"); } c.getDictionary().put(KEY_TYPE, type); return c; } }
BlogPostValidator extends BdfMessageValidator { @Override protected BdfMessageContext validateMessage(Message m, Group g, BdfList body) throws InvalidMessageException, FormatException { BdfMessageContext c; int type = body.getLong(0).intValue(); body.remove(0); switch (MessageType.valueOf(type)) { case POST: c = validatePost(m, g, body); addMessageMetadata(c, m.getTimestamp()); break; case COMMENT: c = validateComment(m, g, body); addMessageMetadata(c, m.getTimestamp()); break; case WRAPPED_POST: c = validateWrappedPost(body); break; case WRAPPED_COMMENT: c = validateWrappedComment(body); break; default: throw new InvalidMessageException("Unknown Message Type"); } c.getDictionary().put(KEY_TYPE, type); return c; } BlogPostValidator(GroupFactory groupFactory, MessageFactory messageFactory,
			BlogFactory blogFactory, ClientHelper clientHelper,
			MetadataEncoder metadataEncoder, Clock clock); }
BlogPostValidator extends BdfMessageValidator { @Override protected BdfMessageContext validateMessage(Message m, Group g, BdfList body) throws InvalidMessageException, FormatException { BdfMessageContext c; int type = body.getLong(0).intValue(); body.remove(0); switch (MessageType.valueOf(type)) { case POST: c = validatePost(m, g, body); addMessageMetadata(c, m.getTimestamp()); break; case COMMENT: c = validateComment(m, g, body); addMessageMetadata(c, m.getTimestamp()); break; case WRAPPED_POST: c = validateWrappedPost(body); break; case WRAPPED_COMMENT: c = validateWrappedComment(body); break; default: throw new InvalidMessageException("Unknown Message Type"); } c.getDictionary().put(KEY_TYPE, type); return c; } BlogPostValidator(GroupFactory groupFactory, MessageFactory messageFactory,
			BlogFactory blogFactory, ClientHelper clientHelper,
			MetadataEncoder metadataEncoder, Clock clock);  }
BlogPostValidator extends BdfMessageValidator { @Override protected BdfMessageContext validateMessage(Message m, Group g, BdfList body) throws InvalidMessageException, FormatException { BdfMessageContext c; int type = body.getLong(0).intValue(); body.remove(0); switch (MessageType.valueOf(type)) { case POST: c = validatePost(m, g, body); addMessageMetadata(c, m.getTimestamp()); break; case COMMENT: c = validateComment(m, g, body); addMessageMetadata(c, m.getTimestamp()); break; case WRAPPED_POST: c = validateWrappedPost(body); break; case WRAPPED_COMMENT: c = validateWrappedComment(body); break; default: throw new InvalidMessageException("Unknown Message Type"); } c.getDictionary().put(KEY_TYPE, type); return c; } BlogPostValidator(GroupFactory groupFactory, MessageFactory messageFactory,
			BlogFactory blogFactory, ClientHelper clientHelper,
			MetadataEncoder metadataEncoder, Clock clock);   }