MetadataManagerImpl implements MetadataManager, SamlHttpRequestUtil { @Override public String getRequestPath(HttpServletRequest httpServletRequest) { String requestURI = httpServletRequest.getRequestURI(); String contextPath = httpServletRequest.getContextPath(); if (Validator.isNotNull(contextPath) && !contextPath.equals(StringPool.SLASH)) { requestURI = requestURI.substring(contextPath.length()); } return _http.removePathParameters(requestURI); }  @Override int getAssertionLifetime(String entityId); @Override String[] getAttributeNames(String entityId); @Override long getClockSkew(); @Override Credential getEncryptionCredential(); @Override EntityDescriptor getEntityDescriptor(
			HttpServletRequest httpServletRequest); @Override String getEntityDescriptorString(
			HttpServletRequest httpServletRequest); @Override MetadataCredentialResolver getMetadataCredentialResolver(); @Override MetadataResolver getMetadataResolver(); @Override String getNameIdAttribute(String entityId); @Override String getNameIdFormat(String entityId); @Override String getRequestPath(HttpServletRequest httpServletRequest); @Override MessageHandler<?> getSecurityMessageHandler(
		HttpServletRequest httpServletRequest, String communicationProfileId,
		boolean requireSignature); @Override SignatureTrustEngine getSignatureTrustEngine(); @Override Credential getSigningCredential(); @Override String getUserAttributeMappings(String entityId); @Override boolean isAttributesEnabled(String entityId); @Override boolean isAttributesNamespaceEnabled(String entityId); @Reference(unbind = "-") void setCredentialResolver(CredentialResolver credentialResolver); @Reference(unbind = "-") void setHttp(Http http); @Reference(unbind = "-") void setLocalEntityManager(LocalEntityManager localEntityManager); @Reference( cardinality = ReferenceCardinality.AT_LEAST_ONE, policyOption = ReferencePolicyOption.GREEDY, scope = ReferenceScope.PROTOTYPE_REQUIRED ) void setMetadataResolver(MetadataResolver metadataResolver); @Reference(unbind = "-") void setParserPool(ParserPool parserPool); @Reference(unbind = "-") void setPortal(Portal portal); @Reference(unbind = "-") void setSamlProviderConfigurationHelper(
		SamlProviderConfigurationHelper samlProviderConfigurationHelper); void unsetMetadataResolver(MetadataResolver metadataResolver);  }
@Test public void testGetRequestPath() { when( _http.removePathParameters( "/c/portal/login;jsessionid=ACD311312312323BF.worker1") ).thenReturn( "/c/portal/login" ); MockHttpServletRequest request = new MockHttpServletRequest( HttpMethods.GET, "/c/portal/login;jsessionid=ACD311312312323BF.worker1"); Assert.assertEquals( "/c/portal/login", metadataManagerImpl.getRequestPath(request)); }
@Test public void testGetRequestPathWithContext() { when( _http.removePathParameters( "/c/portal/login;jsessionid=ACD311312312323BF.worker1") ).thenReturn( "/c/portal/login" ); MockHttpServletRequest request = new MockHttpServletRequest( HttpMethods.GET, "/portal/c/portal/login;jsessionid=ACD311312312323BF.worker1"); request.setContextPath("/portal"); Assert.assertEquals( "/c/portal/login", metadataManagerImpl.getRequestPath(request)); }
@Test public void testGetRequestPathWithoutJsessionId() { when( _http.removePathParameters("/c/portal/login") ).thenReturn( "/c/portal/login" ); MockHttpServletRequest request = new MockHttpServletRequest( HttpMethods.GET, "/c/portal/login"); Assert.assertEquals( "/c/portal/login", metadataManagerImpl.getRequestPath(request)); }