Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHOENIX-7261 Align mockito version with Hadoop and HBase in QueryServer #166

Merged
merged 2 commits into from
Nov 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
9 changes: 5 additions & 4 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.version>4.11.0</mockito.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>
<version>${mockito-all.version}</version>
<scope>test</scope>
<artifactId>mockito-bom</artifactId>
<version>${mockito.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
Expand Down
Loading