File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
spring-boot/spring-boot-testing/src/test/java/io/reflectoring/testing Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 16
16
import org .springframework .test .context .TestPropertySource ;
17
17
import static org .assertj .core .api .Assertions .*;
18
18
import static org .mockito .ArgumentMatchers .any ;
19
+ import static org .mockito .BDDMockito .*;
19
20
import static org .mockito .Mockito .when ;
20
21
21
22
@ SpringBootTest
@@ -32,9 +33,9 @@ void testRegister(){
32
33
// given
33
34
User user =
new User (
"Zaphod" ,
"[email protected] " );
34
35
boolean sendWelcomeMail = true ;
36
+ given (userRepository .save (any (UserEntity .class ))).willReturn (userEntity (1L ));
35
37
36
38
// when
37
- when (userRepository .save (any (UserEntity .class ))).thenReturn (userEntity (1L ));
38
39
Long userId = registerUseCase .registerUser (user , sendWelcomeMail );
39
40
40
41
// then
You can’t perform that action at this time.
0 commit comments