/*
* Copyright (c) MuleSoft, Inc. All rights reserved. http://www.mulesoft.com
* The software in this package is published under the terms of the CPAL v1.0
* license, a copy of which has been included with this distribution in the
* LICENSE.txt file.
*/
package org.mule.module.cxf;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertTrue;
import org.mule.api.MuleMessage;
import org.mule.api.client.LocalMuleClient;
import org.mule.tck.junit4.FunctionalTestCase;
import org.junit.Test;
public class CxfSoapJmsTestCase extends FunctionalTestCase
{
public static final String SAMPLE_REQUEST =
"<soap:Envelope xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"\n" +
" xmlns:hi=\"http://example.cxf.module.mule.org/\">\n" +
"<soap:Body>\n" +
"<hi:sayHi>\n" +
" <arg0>Hello</arg0>\n" +
"</hi:sayHi>\n" +
"</soap:Body>\n" +
"</soap:Envelope>";
@Override
protected String getConfigFile()
{
return "cxf-soapjms-config.xml";
}
@Test
public void processesSoapJmsMessage() throws Exception
{
LocalMuleClient client = muleContext.getClient();
MuleMessage response = client.send("vm://testInput", SAMPLE_REQUEST, null);
assertNotNull("Got a null response", response);
assertTrue("Got wrong response", response.getPayloadAsString().contains("ns2:sayHiResponse"));
}
}