1212import com .searchcode .app .util .LoggerWrapper ;
1313import com .searchcode .app .util .UniqueRepoQueue ;
1414import junit .framework .TestCase ;
15- import org .mockito .Matchers ;
15+ import org .mockito .ArgumentMatchers ;
1616import spark .Request ;
1717
1818import java .util .HashMap ;
1919import java .util .Optional ;
2020import java .util .concurrent .ConcurrentLinkedQueue ;
2121
2222import static org .assertj .core .api .AssertionsForInterfaceTypes .assertThat ;
23- import static org .mockito .Matchers .any ;
24- import static org .mockito .Matchers .anyBoolean ;
25- import static org .mockito .Matchers .anyString ;
23+ import static org .mockito .ArgumentMatchers .any ;
24+ import static org .mockito .ArgumentMatchers .anyBoolean ;
25+ import static org .mockito .ArgumentMatchers .anyString ;
2626import static org .mockito .Mockito .mock ;
2727import static org .mockito .Mockito .times ;
2828import static org .mockito .Mockito .when ;
@@ -159,7 +159,7 @@ public void testRepositoryIndexApiNoRepositorySupplied() {
159159 Request mockRequest = mock (Request .class );
160160 SQLiteRepo mockSQLiteRepo = mock (SQLiteRepo .class );
161161
162- when (mockJobService .forceEnqueue (Matchers . anyObject ())).thenReturn (true );
162+ when (mockJobService .forceEnqueue (ArgumentMatchers . any ())).thenReturn (true );
163163 when (mockSQLiteRepo .getRepoByUrl (anyString ())).thenReturn (Optional .empty ());
164164
165165 ApiRouteService apiRouteService = new ApiRouteService (null , mockJobService , mockSQLiteRepo , null , null , null , new Helpers (), new LoggerWrapper ());
@@ -175,7 +175,7 @@ public void testRepositoryIndexApiNoMatchingRepo() {
175175 Request mockRequest = mock (Request .class );
176176 SQLiteRepo mockSQLiteRepo = mock (SQLiteRepo .class );
177177
178- when (mockJobService .forceEnqueue (Matchers . anyObject ())).thenReturn (true );
178+ when (mockJobService .forceEnqueue (ArgumentMatchers . any ())).thenReturn (true );
179179 when (mockRequest .queryParams ("repoUrl" )).thenReturn ("test" );
180180 when (mockSQLiteRepo .getRepoByUrl (any ())).thenReturn (Optional .empty ());
181181
@@ -192,7 +192,7 @@ public void testRepositoryIndexMatchingRepo() {
192192 Request mockRequest = mock (Request .class );
193193 SQLiteRepo mockSQLiteRepo = mock (SQLiteRepo .class );
194194
195- when (mockJobService .forceEnqueue (Matchers .<RepoResult >anyObject ())).thenReturn (true );
195+ when (mockJobService .forceEnqueue (ArgumentMatchers .<RepoResult >any ())).thenReturn (true );
196196 when (mockRequest .queryParams ("repoUrl" )).thenReturn ("http://test/" );
197197 when (mockSQLiteRepo .getRepoByUrl ("http://test/" )).thenReturn (Optional .of (new RepoResult ()));
198198
@@ -661,7 +661,7 @@ public void testRepoAddNoAuthSucessful() {
661661
662662 assertThat (apiResponse .getMessage ()).isEqualTo ("added repository successfully" );
663663 assertThat (apiResponse .isSucessful ()).isTrue ();
664- verify (mockSQLiteRepo , times (1 )).saveRepo (Matchers . anyObject ());
664+ verify (mockSQLiteRepo , times (1 )).saveRepo (ArgumentMatchers . any ());
665665 }
666666
667667 public void testRepoAddAuthPubMissing () {
@@ -770,6 +770,6 @@ public void testRepoAddAuthValidSigned() {
770770
771771 assertThat (apiResponse .getMessage ()).isEqualTo ("added repository successfully" );
772772 assertThat (apiResponse .isSucessful ()).isTrue ();
773- verify (mockSQLiteRepo , times (1 )).saveRepo (Matchers . anyObject ());
773+ verify (mockSQLiteRepo , times (1 )).saveRepo (ArgumentMatchers . any ());
774774 }
775775}
0 commit comments