Closed ZDenizYStenhaug closed 2 years ago
For the repository tests, the example below could be applied to most of the cases:
@Test
public void testCreateUser() {
Member member = new Member();
member.setEmail("ravikumar@gmail.com");
member.setPassword("ravi2020");
member.setUsername("melon");
Member savedUser = memberRepo.save(member);
Member existUser = testEntityManager.find(Member.class, savedUser.getId());
assertThat(member.getEmail()).isEqualTo(existUser.getEmail());
}
Research integration testing and testing of the functions in the backend that depend on the database.