aboutsummaryrefslogtreecommitdiffstats
path: root/server/sonar-auth-saml
diff options
context:
space:
mode:
authorLéo Geoffroy <leo.geoffroy@sonarsource.com>2023-03-15 13:28:02 +0100
committerPhilippe Perrin <philippe.perrin@sonarsource.com>2023-03-17 10:08:02 +0100
commit545f09ba0f871b1b0736dfe3eca68cc16e81fcc8 (patch)
tree8fede4b46ec18dc0292bdebcc3449256fa95d16b /server/sonar-auth-saml
parentffe809c197e25b98c8edd27491aeab694f98cc59 (diff)
downloadsonarqube-545f09ba0f871b1b0736dfe3eca68cc16e81fcc8.tar.gz
sonarqube-545f09ba0f871b1b0736dfe3eca68cc16e81fcc8.zip
SONAR-18679 update its sonar auth
Diffstat (limited to 'server/sonar-auth-saml')
-rw-r--r--server/sonar-auth-saml/src/it/java/org/sonar/auth/saml/SamlIdentityProviderIT.java (renamed from server/sonar-auth-saml/src/test/java/org/sonar/auth/saml/SamlIdentityProviderTest.java)7
-rw-r--r--server/sonar-auth-saml/src/it/java/org/sonar/auth/saml/SamlMessageIdCheckerIT.java (renamed from server/sonar-auth-saml/src/test/java/org/sonar/auth/saml/SamlMessageIdCheckerTest.java)2
-rw-r--r--server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/encoded_encrypted_response.txt (renamed from server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/encoded_encrypted_response.txt)0
-rw-r--r--server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/encoded_full_response.txt (renamed from server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/encoded_full_response.txt)0
-rw-r--r--server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/encoded_full_response_with_reverse_proxy.txt (renamed from server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/encoded_full_response_with_reverse_proxy.txt)0
-rw-r--r--server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/encoded_minimal_response.txt (renamed from server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/encoded_minimal_response.txt)0
-rw-r--r--server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/encoded_response_without_login.txt (renamed from server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/encoded_response_without_login.txt)0
-rw-r--r--server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/encoded_response_without_name.txt (renamed from server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/encoded_response_without_name.txt)0
-rw-r--r--server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/how_to_generate_test_response.txt (renamed from server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/how_to_generate_test_response.txt)0
9 files changed, 5 insertions, 4 deletions
diff --git a/server/sonar-auth-saml/src/test/java/org/sonar/auth/saml/SamlIdentityProviderTest.java b/server/sonar-auth-saml/src/it/java/org/sonar/auth/saml/SamlIdentityProviderIT.java
index 00add6efabf..f598d9c9969 100644
--- a/server/sonar-auth-saml/src/test/java/org/sonar/auth/saml/SamlIdentityProviderTest.java
+++ b/server/sonar-auth-saml/src/it/java/org/sonar/auth/saml/SamlIdentityProviderIT.java
@@ -51,7 +51,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.sonar.api.utils.log.LoggerLevel.ERROR;
-public class SamlIdentityProviderTest {
+public class SamlIdentityProviderIT {
private static final String SQ_CALLBACK_URL = "http://localhost:9000/oauth2/callback/saml";
/* IDP private key (keep here for future tests with signature)
@@ -391,12 +391,13 @@ public class SamlIdentityProviderTest {
this.response = response;
this.expectedCallbackUrl = expectedCallbackUrl;
Map<String, String[]> parameterMap = new HashMap<>();
- parameterMap.put("SAMLResponse", new String[] {loadResponse(encodedResponseFile)});
+ parameterMap.put("SAMLResponse", new String[]{loadResponse(encodedResponseFile)});
when(getRequest().getParameterMap()).thenReturn(parameterMap);
}
+
private String loadResponse(String file) {
- try (InputStream json = getClass().getResourceAsStream("SamlIdentityProviderTest/" + file)) {
+ try (InputStream json = getClass().getResourceAsStream(SamlIdentityProviderIT.class.getSimpleName() + "/" + file)) {
return IOUtils.toString(json, StandardCharsets.UTF_8);
} catch (IOException e) {
throw new IllegalStateException(e);
diff --git a/server/sonar-auth-saml/src/test/java/org/sonar/auth/saml/SamlMessageIdCheckerTest.java b/server/sonar-auth-saml/src/it/java/org/sonar/auth/saml/SamlMessageIdCheckerIT.java
index 613715ea9d0..517269fe80a 100644
--- a/server/sonar-auth-saml/src/test/java/org/sonar/auth/saml/SamlMessageIdCheckerTest.java
+++ b/server/sonar-auth-saml/src/it/java/org/sonar/auth/saml/SamlMessageIdCheckerIT.java
@@ -35,7 +35,7 @@ import static org.assertj.core.api.Assertions.assertThatThrownBy;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
-public class SamlMessageIdCheckerTest {
+public class SamlMessageIdCheckerIT {
@Rule
public DbTester db = DbTester.create();
diff --git a/server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/encoded_encrypted_response.txt b/server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/encoded_encrypted_response.txt
index dca5abf5fee..dca5abf5fee 100644
--- a/server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/encoded_encrypted_response.txt
+++ b/server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/encoded_encrypted_response.txt
diff --git a/server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/encoded_full_response.txt b/server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/encoded_full_response.txt
index 03e518d3df1..03e518d3df1 100644
--- a/server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/encoded_full_response.txt
+++ b/server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/encoded_full_response.txt
diff --git a/server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/encoded_full_response_with_reverse_proxy.txt b/server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/encoded_full_response_with_reverse_proxy.txt
index 19fced7e70f..19fced7e70f 100644
--- a/server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/encoded_full_response_with_reverse_proxy.txt
+++ b/server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/encoded_full_response_with_reverse_proxy.txt
diff --git a/server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/encoded_minimal_response.txt b/server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/encoded_minimal_response.txt
index 37de1e33673..37de1e33673 100644
--- a/server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/encoded_minimal_response.txt
+++ b/server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/encoded_minimal_response.txt
diff --git a/server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/encoded_response_without_login.txt b/server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/encoded_response_without_login.txt
index 5826b4fb2af..5826b4fb2af 100644
--- a/server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/encoded_response_without_login.txt
+++ b/server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/encoded_response_without_login.txt
diff --git a/server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/encoded_response_without_name.txt b/server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/encoded_response_without_name.txt
index 4dc183e9fcd..4dc183e9fcd 100644
--- a/server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/encoded_response_without_name.txt
+++ b/server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/encoded_response_without_name.txt
diff --git a/server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/how_to_generate_test_response.txt b/server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/how_to_generate_test_response.txt
index bd832eed711..bd832eed711 100644
--- a/server/sonar-auth-saml/src/test/resources/org/sonar/auth/saml/SamlIdentityProviderTest/how_to_generate_test_response.txt
+++ b/server/sonar-auth-saml/src/it/resources/org/sonar/auth/saml/SamlIdentityProviderIT/how_to_generate_test_response.txt