@Test
public void testConstructorAndAccessors() {
RevPerson committer = RevPersonBuilder.build("ksishmael", "kelsey.ishmael@lmnsolutions.com",
12345, 12345);
RevPerson author = RevPersonBuilder.build("test", "test@email.com", 12345, 12345);
ObjectId id = RevObjectTestSupport.hashString("new commit");
ObjectId treeId = RevObjectTestSupport.hashString("test tree");
String message = "This is a test commit";
ImmutableList<ObjectId> parentIds = ImmutableList
.of(RevObjectTestSupport.hashString("Parent 1"));
RevCommit commit = CommitBuilder.create(id, treeId, parentIds, author, committer, message);
assertEquals(committer, commit.getCommitter());
assertEquals(author, commit.getAuthor());
assertEquals(id, commit.getId());
assertEquals(treeId, commit.getTreeId());
assertEquals(message, commit.getMessage());
assertEquals(parentIds, commit.getParentIds());
assertEquals(TYPE.COMMIT, commit.getType());
assertEquals(parentIds.get(0), commit.parentN(0).get());
parentIds = ImmutableList.of();
commit = CommitBuilder.create(id, treeId, parentIds, author, committer, message);
assertEquals(Collections.EMPTY_LIST, commit.getParentIds());
assertEquals(Optional.absent(), commit.parentN(0));
}