Skip to content

Commit

Permalink
PHOENIX-7261 Align mockito version with Hadoop and HBase in QueryServer
Browse files Browse the repository at this point in the history
  • Loading branch information
NihalJain committed Oct 15, 2024
1 parent a77dd19 commit e1db709
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
package org.apache.phoenix.queryserver.server;

import static org.junit.Assert.assertEquals;
import static org.mockito.Matchers.any;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@
*/
package org.apache.phoenix.queryserver.server;

import static org.mockito.Matchers.any;
import static org.mockito.Matchers.anyString;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.ArgumentMatchers.nullable;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
Expand Down Expand Up @@ -59,7 +60,7 @@ public void setup() throws IOException {
public void testSpnegoEnabled() throws IOException {
setupKeytabForSpnego();
// SPENEGO settings will be provided to the builder when enabled
doReturn(builder).when(builder).withSpnego(anyString(), any(String[].class));
doReturn(builder).when(builder).withSpnego(anyString(), nullable(String[].class));
configureAndVerifyImpersonation(builder, false);
// A keytab file will also be provided for automatic login
verify(builder).withAutomaticLogin(any(File.class));
Expand All @@ -78,8 +79,8 @@ public void testSpnegoDisabled() throws IOException {
@Test
public void testCustomServerConfiguration() {
queryServer.enableCustomAuth(builder, CONF, ugi);
verify(builder).withCustomAuthentication(any(AvaticaServerConfiguration.class));
verify(builder, never()).withSpnego(anyString(), any(String[].class));
verify(builder).withCustomAuthentication(nullable(AvaticaServerConfiguration.class));
verify(builder, never()).withSpnego(anyString(), nullable(String[].class));
verify(builder, never()).withAutomaticLogin(any(File.class));
verify(builder, never()).withImpersonation(any(DoAsRemoteUserCallback.class));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.junit.Before;
import org.junit.Test;

import static org.mockito.Matchers.*;
import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;

Expand Down
7 changes: 4 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@

<!-- Test Dependency versions -->
<testng.version>6.10</testng.version>
<mockito-all.version>1.8.5</mockito-all.version>
<mockito-all.version>4.11.0</mockito-all.version>
<junit.version>4.13.2</junit.version>

<!-- Plugin versions -->
Expand Down Expand Up @@ -1206,9 +1206,10 @@
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<artifactId>mockito-bom</artifactId>
<version>${mockito-all.version}</version>
<scope>test</scope>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
Expand Down

0 comments on commit e1db709

Please sign in to comment.