1010import org .springframework .beans .factory .annotation .Autowired ;
1111import org .springframework .boot .test .autoconfigure .graphql .tester .AutoConfigureGraphQlTester ;
1212import org .springframework .boot .test .context .SpringBootTest ;
13- import org .springframework .boot .test .mock .mockito .MockBean ;
1413import org .springframework .graphql .test .tester .GraphQlTester ;
1514import org .springframework .test .annotation .DirtiesContext ;
1615import org .springframework .test .context .TestPropertySource ;
16+ import org .springframework .test .context .bean .override .mockito .MockitoBean ;
1717import reactor .core .publisher .Flux ;
1818import reactor .core .publisher .Mono ;
1919
@@ -35,10 +35,10 @@ public class InterviewGraphQlTest {
3535 @ Autowired
3636 private GraphQlTester graphQlTester ;
3737
38- @ MockBean
38+ @ MockitoBean
3939 InterviewRepository interviewRepository ;
4040
41- @ MockBean
41+ @ MockitoBean
4242 JobApplicationRepository jobApplicationRepository ;
4343
4444 private Interview interview1 ;
@@ -86,9 +86,9 @@ void testAllInterview() {
8686 .entityList (Interview .class )
8787 .hasSize (3 )
8888 .satisfies (offers -> {
89- assertEquals (offers .get (0 ).getJobApplication ().getCompanyName (), "Company A" );
90- assertEquals (offers .get (1 ).getJobApplication ().getCompanyName (), "Company A" );
91- assertEquals (offers .get (2 ).getJobApplication ().getCompanyName (), "Company B" );
89+ assertEquals ("Company A" , offers .get (0 ).getJobApplication ().getCompanyName ());
90+ assertEquals ("Company A" , offers .get (1 ).getJobApplication ().getCompanyName ());
91+ assertEquals ("Company B" , offers .get (2 ).getJobApplication ().getCompanyName ());
9292 });
9393
9494 verify (interviewRepository , times (1 )).findAll ();
@@ -175,7 +175,7 @@ void testAllInterviewByJobApplicationId() {
175175 @ Test
176176 void testAllInterviewByJobApplicationIdWhenOnlyOneMatches () {
177177 when (interviewRepository .findAllByJobApplicationId (2 )).thenReturn (Flux .just (interview3 ));
178- when (jobApplicationRepository .findById (1 )).thenReturn (Mono .just (jobApplication2 ));
178+ when (jobApplicationRepository .findById (2 )).thenReturn (Mono .just (jobApplication2 ));
179179
180180 String document = """
181181 query {
0 commit comments