aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-webserver-auth
diff options
context:
space:
mode:
authorLéo Geoffroy <99647462+leo-geoffroy-sonarsource@users.noreply.github.com>2022-04-04 18:08:34 +0200
committersonartech <sonartech@sonarsource.com>2022-04-04 20:02:56 +0000
commit12939729652fad6fa91b72c2139da65dc07ec7e0 (patch)
tree4752663c64fe527eabe2129028a22a1f394351cb /server/sonar-webserver-auth
parent328aa8c538d17bb2c0f201de221e7edeff5e1349 (diff)
downloadsonarqube-12939729652fad6fa91b72c2139da65dc07ec7e0.tar.gz
sonarqube-12939729652fad6fa91b72c2139da65dc07ec7e0.zip
NO-JIRA Update Mockito and simpleframework to latest major version
Diffstat (limited to 'server/sonar-webserver-auth')
-rw-r--r--server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/BasicAuthenticationTest.java14
-rw-r--r--server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/CredentialsExternalAuthenticationTest.java8
-rw-r--r--server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/HttpHeadersAuthenticationTest.java12
-rw-r--r--server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/InitFilterTest.java20
-rw-r--r--server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/OAuth2CallbackFilterTest.java8
-rw-r--r--server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/event/AuthenticationEventImplTest.java10
6 files changed, 36 insertions, 36 deletions
diff --git a/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/BasicAuthenticationTest.java b/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/BasicAuthenticationTest.java
index b83866f91f7..d80ff6aa193 100644
--- a/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/BasicAuthenticationTest.java
+++ b/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/BasicAuthenticationTest.java
@@ -38,8 +38,8 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
import static org.sonar.server.authentication.event.AuthenticationEvent.Method.BASIC;
import static org.sonar.server.authentication.event.AuthenticationEvent.Method.BASIC_TOKEN;
@@ -98,7 +98,7 @@ public class BasicAuthenticationTest {
public void does_not_authenticate_when_no_authorization_header() {
underTest.authenticate(request);
- verifyZeroInteractions(credentialsAuthentication, authenticationEvent);
+ verifyNoInteractions(credentialsAuthentication, authenticationEvent);
}
@Test
@@ -107,7 +107,7 @@ public class BasicAuthenticationTest {
underTest.authenticate(request);
- verifyZeroInteractions(credentialsAuthentication, authenticationEvent);
+ verifyNoInteractions(credentialsAuthentication, authenticationEvent);
}
@Test
@@ -118,7 +118,7 @@ public class BasicAuthenticationTest {
.isInstanceOf(AuthenticationException.class)
.hasFieldOrPropertyWithValue("source", Source.local(BASIC));
- verifyZeroInteractions(authenticationEvent);
+ verifyNoInteractions(authenticationEvent);
}
@Test
@@ -154,7 +154,7 @@ public class BasicAuthenticationTest {
.isInstanceOf(AuthenticationException.class)
.hasFieldOrPropertyWithValue("source", Source.local(BASIC_TOKEN));
- verifyZeroInteractions(authenticationEvent);
+ verifyNoInteractions(authenticationEvent);
}
@Test
@@ -167,7 +167,7 @@ public class BasicAuthenticationTest {
.isInstanceOf(AuthenticationException.class)
.hasFieldOrPropertyWithValue("source", Source.local(BASIC_TOKEN));
- verifyZeroInteractions(authenticationEvent);
+ verifyNoInteractions(authenticationEvent);
}
@Test
@@ -181,7 +181,7 @@ public class BasicAuthenticationTest {
.isInstanceOf(AuthenticationException.class)
.hasFieldOrPropertyWithValue("source", Source.local(BASIC_TOKEN));
- verifyZeroInteractions(authenticationEvent);
+ verifyNoInteractions(authenticationEvent);
}
private static String toBase64(String text) {
diff --git a/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/CredentialsExternalAuthenticationTest.java b/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/CredentialsExternalAuthenticationTest.java
index 02661e1ff2a..e343190c734 100644
--- a/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/CredentialsExternalAuthenticationTest.java
+++ b/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/CredentialsExternalAuthenticationTest.java
@@ -40,8 +40,8 @@ import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.verifyNoMoreInteractions;
-import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.when;
import static org.sonar.server.authentication.event.AuthenticationEvent.Method.BASIC;
import static org.sonar.server.authentication.event.AuthenticationEvent.Method.BASIC_TOKEN;
@@ -190,7 +190,7 @@ public class CredentialsExternalAuthenticationTest {
.hasFieldOrPropertyWithValue("source", Source.realm(BASIC, REALM_NAME))
.hasFieldOrPropertyWithValue("login", LOGIN);
- verifyZeroInteractions(authenticationEvent);
+ verifyNoInteractions(authenticationEvent);
}
@Test
@@ -206,7 +206,7 @@ public class CredentialsExternalAuthenticationTest {
.hasFieldOrPropertyWithValue("source", Source.realm(BASIC, REALM_NAME))
.hasFieldOrPropertyWithValue("login", LOGIN);
- verifyZeroInteractions(authenticationEvent);
+ verifyNoInteractions(authenticationEvent);
}
@@ -224,7 +224,7 @@ public class CredentialsExternalAuthenticationTest {
.hasFieldOrPropertyWithValue("source", Source.realm(BASIC_TOKEN, REALM_NAME))
.hasFieldOrPropertyWithValue("login", LOGIN);
- verifyZeroInteractions(authenticationEvent);
+ verifyNoInteractions(authenticationEvent);
}
@Test
diff --git a/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/HttpHeadersAuthenticationTest.java b/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/HttpHeadersAuthenticationTest.java
index 34de3ae50e6..6a8b42ab979 100644
--- a/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/HttpHeadersAuthenticationTest.java
+++ b/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/HttpHeadersAuthenticationTest.java
@@ -55,7 +55,7 @@ import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
import static org.sonar.db.user.UserTesting.newUserDto;
@@ -207,7 +207,7 @@ public class HttpHeadersAuthenticationTest {
// User is not updated
verifyUserInDb(DEFAULT_LOGIN, DEFAULT_NAME, DEFAULT_EMAIL, group1);
verifyTokenIsNotUpdated();
- verifyZeroInteractions(authenticationEvent);
+ verifyNoInteractions(authenticationEvent);
}
@Test
@@ -255,7 +255,7 @@ public class HttpHeadersAuthenticationTest {
// User is not updated
verifyUserInDb(DEFAULT_LOGIN, DEFAULT_NAME, DEFAULT_EMAIL, group1);
verifyTokenIsNotUpdated();
- verifyZeroInteractions(authenticationEvent);
+ verifyNoInteractions(authenticationEvent);
}
@Test
@@ -325,7 +325,7 @@ public class HttpHeadersAuthenticationTest {
verifyUserNotAuthenticated();
verifyTokenIsNotUpdated();
- verifyZeroInteractions(authenticationEvent);
+ verifyNoInteractions(authenticationEvent);
}
@Test
@@ -335,7 +335,7 @@ public class HttpHeadersAuthenticationTest {
underTest.authenticate(createRequest(DEFAULT_LOGIN, DEFAULT_NAME, DEFAULT_EMAIL, GROUPS), response);
verifyUserNotAuthenticated();
- verifyZeroInteractions(jwtHttpHandler, authenticationEvent);
+ verifyNoInteractions(jwtHttpHandler, authenticationEvent);
}
@Test
@@ -348,7 +348,7 @@ public class HttpHeadersAuthenticationTest {
.isInstanceOf(AuthenticationException.class)
.hasFieldOrPropertyWithValue("source", Source.sso());
- verifyZeroInteractions(authenticationEvent);
+ verifyNoInteractions(authenticationEvent);
}
private void startWithSso() {
diff --git a/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/InitFilterTest.java b/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/InitFilterTest.java
index fb162f465b8..b37ce1bf893 100644
--- a/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/InitFilterTest.java
+++ b/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/InitFilterTest.java
@@ -42,7 +42,7 @@ import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.never;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
public class InitFilterTest {
@@ -97,7 +97,7 @@ public class InitFilterTest {
underTest.doFilter(request, response, chain);
assertOAuth2InitCalled();
- verifyZeroInteractions(authenticationEvent);
+ verifyNoInteractions(authenticationEvent);
}
@Test
@@ -108,7 +108,7 @@ public class InitFilterTest {
underTest.doFilter(request, response, chain);
assertOAuth2InitCalled();
- verifyZeroInteractions(authenticationEvent);
+ verifyNoInteractions(authenticationEvent);
}
@Test
@@ -119,7 +119,7 @@ public class InitFilterTest {
underTest.doFilter(request, response, chain);
assertBasicInitCalled();
- verifyZeroInteractions(authenticationEvent);
+ verifyNoInteractions(authenticationEvent);
}
@Test
@@ -150,8 +150,8 @@ public class InitFilterTest {
underTest.doFilter(request, response, chain);
assertError("No provider key found in URI");
- verifyZeroInteractions(authenticationEvent);
- verifyZeroInteractions(auth2AuthenticationParameters);
+ verifyNoInteractions(authenticationEvent);
+ verifyNoInteractions(auth2AuthenticationParameters);
}
@Test
@@ -161,8 +161,8 @@ public class InitFilterTest {
underTest.doFilter(request, response, chain);
assertError("No provider key found in URI");
- verifyZeroInteractions(authenticationEvent);
- verifyZeroInteractions(auth2AuthenticationParameters);
+ verifyNoInteractions(authenticationEvent);
+ verifyNoInteractions(auth2AuthenticationParameters);
}
@Test
@@ -175,8 +175,8 @@ public class InitFilterTest {
underTest.doFilter(request, response, chain);
assertError("Unsupported IdentityProvider class: class org.sonar.server.authentication.InitFilterTest$UnsupportedIdentityProvider");
- verifyZeroInteractions(authenticationEvent);
- verifyZeroInteractions(auth2AuthenticationParameters);
+ verifyNoInteractions(authenticationEvent);
+ verifyNoInteractions(auth2AuthenticationParameters);
}
@Test
diff --git a/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/OAuth2CallbackFilterTest.java b/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/OAuth2CallbackFilterTest.java
index 73afe2da1d5..f9912c29f8e 100644
--- a/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/OAuth2CallbackFilterTest.java
+++ b/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/OAuth2CallbackFilterTest.java
@@ -40,7 +40,7 @@ import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
import static org.sonar.server.authentication.event.AuthenticationEvent.Source;
@@ -136,7 +136,7 @@ public class OAuth2CallbackFilterTest {
underTest.doFilter(request, response, chain);
assertError("Not an OAuth2IdentityProvider: class org.sonar.server.authentication.FakeBasicIdentityProvider");
- verifyZeroInteractions(authenticationEvent);
+ verifyNoInteractions(authenticationEvent);
}
@Test
@@ -147,7 +147,7 @@ public class OAuth2CallbackFilterTest {
underTest.doFilter(request, response, chain);
assertError("Failed to retrieve IdentityProvider for key 'github'");
- verifyZeroInteractions(authenticationEvent);
+ verifyNoInteractions(authenticationEvent);
}
@Test
@@ -222,7 +222,7 @@ public class OAuth2CallbackFilterTest {
underTest.doFilter(request, response, chain);
assertError("No provider key found in URI");
- verifyZeroInteractions(authenticationEvent);
+ verifyNoInteractions(authenticationEvent);
}
private void assertCallbackCalled(FakeOAuth2IdentityProvider oAuth2IdentityProvider) {
diff --git a/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/event/AuthenticationEventImplTest.java b/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/event/AuthenticationEventImplTest.java
index 37f9861e33c..98f9db19d83 100644
--- a/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/event/AuthenticationEventImplTest.java
+++ b/server/sonar-webserver-auth/src/test/java/org/sonar/server/authentication/event/AuthenticationEventImplTest.java
@@ -35,7 +35,7 @@ import static java.util.Arrays.asList;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verifyZeroInteractions;
+import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
import static org.sonar.server.authentication.event.AuthenticationEvent.Method;
import static org.sonar.server.authentication.event.AuthenticationEvent.Source;
@@ -80,7 +80,7 @@ public class AuthenticationEventImplTest {
underTest.loginSuccess(request, "login", Source.sso());
- verifyZeroInteractions(request);
+ verifyNoInteractions(request);
}
@Test
@@ -154,7 +154,7 @@ public class AuthenticationEventImplTest {
underTest.loginFailure(request, exception);
- verifyZeroInteractions(request, exception);
+ verifyNoInteractions(request, exception);
}
@Test
@@ -252,7 +252,7 @@ public class AuthenticationEventImplTest {
underTest.logoutSuccess(request, "foo");
- verifyZeroInteractions(request);
+ verifyNoInteractions(request);
}
@Test
@@ -317,7 +317,7 @@ public class AuthenticationEventImplTest {
underTest.logoutFailure(request, "bad csrf");
- verifyZeroInteractions(request);
+ verifyNoInteractions(request);
}
@Test