Skip to content

Commit

Permalink
[#54] test: FollowRepository 인스턴스 delete() 테스트 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
kwj1270 committed Oct 3, 2021
1 parent f0d4e88 commit 0694f5f
Showing 1 changed file with 15 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,21 @@ void findById_test() {
);
}

@DisplayName("FollowRepository 인스턴스 delete() 테스트")
@Test
void delete_test() {
final User following = userBuilder(new Email(EMAIL), new Name(USERNAME), new Password(PASSWORD), new Bio(BIO), new Image(IMAGE));
final User follower = userBuilder(new Email("Email2@email.com"), new Name("differentUserName"), new Password("Password2"), new Bio("Bio2"), new Image("Image2"));
final Follow follow = followBuilder(following, follower);

testEntityManager.persist(following);
testEntityManager.persist(follower);
testEntityManager.persist(follow);

final Follow findFollow = followRepository.findById(1L).get();
followRepository.delete(findFollow);

assertThat(followRepository.count()).isEqualTo(0);
}

}

0 comments on commit 0694f5f

Please sign in to comment.