develog

[junit5] mockito 본문

Dev/junit

[junit5] mockito

냐옴 2020. 3. 7. 00:29

 

@ExtendWith(MockitoExtension.class)
class UserServiceTest {

    @Mock
    UserRepository userRepository;

    @InjectMocks
    UserService userService;

    @Test
    void test_00() throws Exception {
        assertThat(userService).isNotNull();
        assertThat(userRepository).isNotNull();
    }

}

'Dev > junit' 카테고리의 다른 글

[junit5] @DisplayName 제대로 표시안될 때  (0) 2020.08.04
[junit] gradle junit5  (0) 2020.04.21
[junit5] controller test @WebMvcTest  (0) 2020.03.02
[junit5] controller test @SpringBootTest  (0) 2020.02.29
[Junit] Test Assertion  (0) 2019.12.23
Comments