Add helper method for encoding authors.

This commit is contained in:
akwizgran
2018-01-16 17:22:35 +00:00
parent 1d81110fe5
commit 68634e0f28
3 changed files with 19 additions and 0 deletions

View File

@@ -331,6 +331,18 @@ public class ClientHelperImplTest extends BrambleTestCase {
}
}
@Test
public void testParsesAndEncodesAuthor() throws Exception {
context.checking(new Expectations() {{
oneOf(authorFactory).createAuthor(author.getFormatVersion(),
author.getName(), author.getPublicKey());
will(returnValue(author));
}});
BdfList authorList = clientHelper.toList(author);
assertEquals(author, clientHelper.parseAndValidateAuthor(authorList));
}
@Test
public void testAcceptsValidAuthor() throws Exception {
BdfList authorList = BdfList.of(