Search in sources :

Example 6 with MessageAddressingProperties

use of org.springframework.ws.soap.addressing.core.MessageAddressingProperties in project camel by apache.

the class ProducerParamsPrecedenceTest method testReplyToPrecedence.

@Test
public void testReplyToPrecedence() throws Exception {
    template.requestBody("direct:precedenceReplyTo", xmlBody);
    assertNotNull(sender.getMessageContext());
    // check default actions
    Assertions.assertThat(sender.getMessageContext()).isNotNull();
    MessageAddressingProperties wsaProperties = TestUtil.getWSAProperties((SoapMessage) sender.getMessageContext().getRequest());
    Assertions.assertThat(wsaProperties).isNotNull();
    Assertions.assertThat(wsaProperties.getReplyTo().getAddress()).isEqualTo(new URI("http://replyPrecedence.to"));
    Assertions.assertThat(wsaProperties.getFaultTo().getAddress()).isEqualTo(new URI("http://faultPrecedence.to"));
}
Also used : MessageAddressingProperties(org.springframework.ws.soap.addressing.core.MessageAddressingProperties) URI(java.net.URI) Test(org.junit.Test)

Example 7 with MessageAddressingProperties

use of org.springframework.ws.soap.addressing.core.MessageAddressingProperties in project camel by apache.

the class ProducerParamsBasicTest method testReplyDoesntFollowFault.

@Test
public void testReplyDoesntFollowFault() throws Exception {
    template.requestBody("direct:omittedReplyTo", xmlBody);
    assertNotNull(sender.getMessageContext());
    // check default actions
    Assertions.assertThat(sender.getMessageContext()).isNotNull();
    MessageAddressingProperties wsaProperties = TestUtil.getWSAProperties((SoapMessage) sender.getMessageContext().getRequest());
    Assertions.assertThat(wsaProperties).isNotNull();
    Assertions.assertThat(wsaProperties.getReplyTo().getAddress()).isEqualTo(anonymousUri);
    Assertions.assertThat(wsaProperties.getFaultTo().getAddress()).isEqualTo(new URI("http://fault.to"));
}
Also used : MessageAddressingProperties(org.springframework.ws.soap.addressing.core.MessageAddressingProperties) URI(java.net.URI) Test(org.junit.Test)

Example 8 with MessageAddressingProperties

use of org.springframework.ws.soap.addressing.core.MessageAddressingProperties in project camel by apache.

the class ProducerParamsBasicTest method testEmptyReplyAndFaultAndActionMustBePresent.

@Test
public void testEmptyReplyAndFaultAndActionMustBePresent() throws Exception {
    template.requestBody("direct:empty", xmlBody);
    assertNotNull(sender.getMessageContext());
    // check default actions
    Assertions.assertThat(sender.getMessageContext()).isNotNull();
    MessageAddressingProperties wsaProperties = TestUtil.getWSAProperties((SoapMessage) sender.getMessageContext().getRequest());
    Assertions.assertThat(wsaProperties).isNotNull();
    Assertions.assertThat(wsaProperties.getAction()).isEqualTo(new URI("http://turnOnWSA.com"));
    Assertions.assertThat(wsaProperties.getReplyTo().getAddress()).isEqualTo(anonymousUri);
    Assertions.assertThat(wsaProperties.getFaultTo().getAddress()).isEqualTo(anonymousUri);
}
Also used : MessageAddressingProperties(org.springframework.ws.soap.addressing.core.MessageAddressingProperties) URI(java.net.URI) Test(org.junit.Test)

Example 9 with MessageAddressingProperties

use of org.springframework.ws.soap.addressing.core.MessageAddressingProperties in project camel by apache.

the class ProducerParamsBasicTest method testDefaulFaultTo.

@Test
public void testDefaulFaultTo() throws Exception {
    template.requestBody("direct:defaultFault", xmlBody);
    assertNotNull(sender.getMessageContext());
    // check default actions
    Assertions.assertThat(sender.getMessageContext()).isNotNull();
    MessageAddressingProperties wsaProperties = TestUtil.getWSAProperties((SoapMessage) sender.getMessageContext().getRequest());
    Assertions.assertThat(wsaProperties).isNotNull();
    Assertions.assertThat(wsaProperties.getReplyTo().getAddress()).isEqualTo(anonymousUri);
    Assertions.assertThat(wsaProperties.getFaultTo().getAddress()).isEqualTo(anonymousUri);
}
Also used : MessageAddressingProperties(org.springframework.ws.soap.addressing.core.MessageAddressingProperties) Test(org.junit.Test)

Example 10 with MessageAddressingProperties

use of org.springframework.ws.soap.addressing.core.MessageAddressingProperties in project camel by apache.

the class ProducerParamsBasicTest method testFaultFollowsReply.

@Test
public void testFaultFollowsReply() throws Exception {
    template.requestBody("direct:omittedFaultTo", xmlBody);
    assertNotNull(sender.getMessageContext());
    // check default actions
    Assertions.assertThat(sender.getMessageContext()).isNotNull();
    MessageAddressingProperties wsaProperties = TestUtil.getWSAProperties((SoapMessage) sender.getMessageContext().getRequest());
    Assertions.assertThat(wsaProperties).isNotNull();
    Assertions.assertThat(wsaProperties.getReplyTo().getAddress()).isEqualTo(new URI("http://reply.to"));
    Assertions.assertThat(wsaProperties.getFaultTo().getAddress()).isEqualTo(new URI("http://reply.to"));
}
Also used : MessageAddressingProperties(org.springframework.ws.soap.addressing.core.MessageAddressingProperties) URI(java.net.URI) Test(org.junit.Test)

Aggregations

MessageAddressingProperties (org.springframework.ws.soap.addressing.core.MessageAddressingProperties)17 Test (org.junit.Test)14 URI (java.net.URI)9 SoapMessage (org.springframework.ws.soap.SoapMessage)3 Ignore (org.junit.Ignore)2