From c612f931378df20605d808d9b2c73f39eae5eb41 Mon Sep 17 00:00:00 2001 From: Okke Harsta Date: Fri, 8 May 2020 17:21:56 +0200 Subject: [PATCH] Removed unused variable --- mujina-idp/src/main/java/mujina/idp/MetadataController.java | 3 --- .../src/test/java/mujina/idp/MetadataControllerTest.java | 6 +++++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/mujina-idp/src/main/java/mujina/idp/MetadataController.java b/mujina-idp/src/main/java/mujina/idp/MetadataController.java index 06ac8792..2c15573a 100644 --- a/mujina-idp/src/main/java/mujina/idp/MetadataController.java +++ b/mujina-idp/src/main/java/mujina/idp/MetadataController.java @@ -78,9 +78,6 @@ public String metadata(@Value("${idp.base_url}") String idpBaseUrl) throws Secur idpssoDescriptor.addSupportedProtocol(SAMLConstants.SAML20P_NS); - String localPort = environment.getProperty("local.server.port"); - - SingleSignOnService singleSignOnService = buildSAMLObject(SingleSignOnService.class, SingleSignOnService.DEFAULT_ELEMENT_NAME); singleSignOnService.setLocation(idpBaseUrl + "/SingleSignOnService"); singleSignOnService.setBinding(SAMLConstants.SAML2_REDIRECT_BINDING_URI); diff --git a/mujina-idp/src/test/java/mujina/idp/MetadataControllerTest.java b/mujina-idp/src/test/java/mujina/idp/MetadataControllerTest.java index 25059ceb..bbfd3111 100644 --- a/mujina-idp/src/test/java/mujina/idp/MetadataControllerTest.java +++ b/mujina-idp/src/test/java/mujina/idp/MetadataControllerTest.java @@ -2,6 +2,7 @@ import mujina.AbstractIntegrationTest; import org.junit.Test; +import org.springframework.beans.factory.annotation.Value; import static io.restassured.RestAssured.given; import static io.restassured.config.RestAssuredConfig.newConfig; @@ -11,6 +12,9 @@ public class MetadataControllerTest extends AbstractIntegrationTest { + @Value("${idp.base_url}") + private String idpBaseUrl; + @Test public void metadata() throws Exception { given() @@ -22,7 +26,7 @@ public void metadata() throws Exception { .statusCode(SC_OK) .body( "EntityDescriptor.IDPSSODescriptor.SingleSignOnService.@Location", - equalTo("http://localhost:8080/SingleSignOnService")); + equalTo(idpBaseUrl + "/SingleSignOnService")); } }