Skip to content

Commit

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

@DisplayName("FollowRepository 인스턴스 findById() 테스트")
@Test
void findById_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();

assertAll(
() -> assertThat(findFollow).isNotNull(),
() -> assertThat(findFollow).isExactlyInstanceOf(Follow.class),
() -> assertThat(findFollow).isEqualTo(follow)
);
}



}

0 comments on commit f0d4e88

Please sign in to comment.