Search in sources :

Example 1 with FaultMessageResolver

use of org.springframework.ws.client.core.FaultMessageResolver in project spring-boot by spring-projects.

the class WebServiceTemplateBuilderTests method setFaultMessageResolver.

@Test
void setFaultMessageResolver() {
    FaultMessageResolver faultMessageResolver = mock(FaultMessageResolver.class);
    WebServiceTemplate webServiceTemplate = this.builder.setFaultMessageResolver(faultMessageResolver).build();
    assertThat(webServiceTemplate.getFaultMessageResolver()).isEqualTo(faultMessageResolver);
}
Also used : FaultMessageResolver(org.springframework.ws.client.core.FaultMessageResolver) WebServiceTemplate(org.springframework.ws.client.core.WebServiceTemplate) Test(org.junit.jupiter.api.Test)

Example 2 with FaultMessageResolver

use of org.springframework.ws.client.core.FaultMessageResolver in project spring-integration by spring-projects.

the class WebServiceOutboundGatewayParserTests method simpleGatewayWithCustomFaultMessageResolver.

@Test
public void simpleGatewayWithCustomFaultMessageResolver() {
    AbstractEndpoint endpoint = this.context.getBean("gatewayWithCustomFaultMessageResolver", AbstractEndpoint.class);
    assertEquals(EventDrivenConsumer.class, endpoint.getClass());
    Object gateway = new DirectFieldAccessor(endpoint).getPropertyValue("handler");
    assertEquals(SimpleWebServiceOutboundGateway.class, gateway.getClass());
    DirectFieldAccessor accessor = new DirectFieldAccessor(gateway);
    accessor = new DirectFieldAccessor(accessor.getPropertyValue("webServiceTemplate"));
    FaultMessageResolver resolver = (FaultMessageResolver) context.getBean("faultMessageResolver");
    assertEquals(resolver, accessor.getPropertyValue("faultMessageResolver"));
}
Also used : AbstractEndpoint(org.springframework.integration.endpoint.AbstractEndpoint) FaultMessageResolver(org.springframework.ws.client.core.FaultMessageResolver) DirectFieldAccessor(org.springframework.beans.DirectFieldAccessor) Test(org.junit.Test)

Aggregations

FaultMessageResolver (org.springframework.ws.client.core.FaultMessageResolver)2 Test (org.junit.Test)1 Test (org.junit.jupiter.api.Test)1 DirectFieldAccessor (org.springframework.beans.DirectFieldAccessor)1 AbstractEndpoint (org.springframework.integration.endpoint.AbstractEndpoint)1 WebServiceTemplate (org.springframework.ws.client.core.WebServiceTemplate)1