@@ -0,0 +1,2466 @@
+/*%0A * Copyright 2004,2015 The Apache Software Foundation.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage org.apache.rampart;%0A%0Aimport junit.framework.Assert;%0Aimport org.apache.axiom.om.OMElement;%0Aimport org.apache.axiom.om.util.AXIOMUtil;%0Aimport org.apache.axis2.context.ConfigurationContext;%0Aimport org.apache.rahas.TrustException;%0Aimport org.apache.rahas.client.STSClient;%0A%0Apublic class SecurityTokenRequestTemplateTest extends MessageBuilderTestBase %7B%0A%0A    public void testSecurityTokenRequestTemplateClone() %7B%0A%0A        String tokenRequestTemplate = %22%3Csp:RequestSecurityTokenTemplate xmlns:sp=%5C%22http://schemas.xmlsoap%22 +%0A                %22.org/ws/2005/07/securitypolicy%5C%22 xmlns:wst=%5C%22http://schemas.xmlsoap.org/ws/2005/02/trust%5C%22%3E%5Cn%22 +%0A                %22%3Cwst:TokenType%3Ehttp://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0%3C/wst:TokenType%3E%5Cn%22 +%0A                %22%3Cwst:KeyType%3Ehttp://schemas.xmlsoap.org/ws/2005/02/trust/Bearer%3C/wst:KeyType%3E%5Cn%22 +%0A                %22%3Ct:KeySize xmlns:t=%5C%22http://schemas.xmlsoap.org/ws/2005/02/trust%5C%22%3E256%3C/t:KeySize%3E%5Cn%22 +%0A                %22%3Ct:KeySizee xmlns:t=%5C%22http://schemas.xmlsoap.org/ws/2005/02/trust%5C%22%3E256%3C/t:KeySizee%3E%5Cn%22 +%0A                %22%3C/sp:RequestSecurityTokenTemplate%3E%22;%0A%0A        String tokenType = %22%3Cwst:TokenType%3Ehttp://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2%22 +%0A                %22.0%3C/wst:TokenType%3E%22;%0A%0A        try %7B%0A            ConfigurationContext configCtx = getMsgCtx().getConfigurationContext();%0A            STSClient client = new STSClient(configCtx);%0A            OMElement omElement = AXIOMUtil.stringToOM(tokenRequestTemplate);%0A            client.setRstTemplate(omElement);%0A            client.createIssueRequest(%22%22, %22%22);%0A            Assert.assertTrue(omElement.toString().contains(tokenType));%0A        %7D catch (TrustException e) %7B%0A            fail(e.getMessage());%0A        %7D catch (Exception e) %7B%0A            fail(e.getMessage());%0A        %7D%0A%0A    %7D%0A%7D%0A

Test case for IDENTITY-4634