Ignore:
Timestamp:
04/20/12 12:59:56 (12 years ago)
Author:
twagoo
Message:

CommentsDao?.getById takes Id as Number. Added test for this method

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentRegistry/src/test/java/clarin/cmdi/componentregistry/impl/database/CommentsDaoTest.java

    r1697 r1895  
    7878        assertEquals(TEST_COMMENT_USER_NAME, comments.get(0).getUserName());
    7979        assertEquals(Integer.toString(TEST_COMMENT_USER_ID), comments.get(0).getUserId());
     80    }
     81
     82    @Test
     83    public void testGetById() {
     84        Comment comment1 = createTestComment();
     85        comment1.setProfileDescriptionId(TEST_COMMENT_PROFILE_ID);
     86        Number commentId = commentsDao.insertComment(comment1, TEST_COMMENT_USER_ID);
     87        Comment commentById = commentsDao.getById(commentId);
     88        assertEquals(TEST_COMMENT_PROFILE_ID, commentById.getProfileDescriptionId());
     89        assertEquals(TEST_COMMENT_NAME, commentById.getComment());
    8090    }
    8191
Note: See TracChangeset for help on using the changeset viewer.