package com.atlassian.stash.internal.comment;

import org.junit.Test;

import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertSame;

public final class InternalCommentTest {

    @Test
    public void testImpossibleToAssignParentAsSelf() throws Exception {
        InternalComment c1 = new InternalComment.Builder().id(1L).build();
        InternalComment c2 = new InternalComment.Builder(c1).root(c1).parent(c1).build();
        assertNull(c2.getParent());
        assertSame(c2.getRoot(), c2);
    }
}
