@Test public void save() { // Given Integer count = likeDao.count(); // When likeDao.save(createLike()); // Then assertThat(likeDao.count(), is(count + 1)); }
@Test public void getByProviderUserId() { // Given Like likeTmp = createLike(); likeDao.save(likeTmp); // When Like like = likeDao.getByProviderUserId(likeTmp.getProviderUserId()).get(0); // Then assertThat(like.getProviderUserId(), is(likeTmp.getProviderUserId())); }
@Test public void delete() { // Given Like like = createLike(); likeDao.save(like); Integer count = likeDao.count(); // When Map<String, Object> map = new HashMap<String, Object>(); map.put("providerUserId", providerUserId); map.put("documentId", documentId); likeDao.delete(map); // Then assertThat(likeDao.count(), is(count - 1)); }