コード例 #1
0
  @Test
  public void testEquals() {
    final ContentId contentId = ContentId.from("a");

    final ContentPath parentPath = ContentPath.ROOT;

    MoveContentParams params = new MoveContentParams(contentId, parentPath);
    params.creator(PrincipalKey.ofAnonymous());

    assertEquals(contentId, params.getContentId());
    assertEquals(parentPath, params.getParentContentPath());
    assertEquals(PrincipalKey.ofAnonymous(), params.getCreator());

    MoveContentParams params2 =
        new MoveContentParams(params.getContentId(), params.getParentContentPath());

    assertEquals(params, params2);
    assertEquals(params.hashCode(), params2.hashCode());
  }
コード例 #2
0
 @Test(expected = NullPointerException.class)
 public void testValidate() {
   MoveContentParams invalidParams = new MoveContentParams(null, ContentPath.ROOT);
   invalidParams.validate();
 }