@Test public void testLikeCount() throws Exception { Video v; // Add the video v = readWriteVideoSvcUser1.addVideo(video); long id = v.getId(); // Like the video readWriteVideoSvcUser1.likeVideo(id); // Get the video again v = readWriteVideoSvcUser1.getVideoById(id); // Make sure the like count is 1 assertTrue(v.getLikes() == 1); // Unlike the video readWriteVideoSvcUser1.unlikeVideo(v.getId()); // Get the video again v = readWriteVideoSvcUser1.getVideoById(v.getId()); // Make sure the like count is 0 assertTrue(v.getLikes() == 0); }