use of org.springframework.xml.transform.StringSource in project spring-boot by spring-projects.
the class WebServiceClientIntegrationTests method mockServerCall2.
@Test
void mockServerCall2() {
this.server.expect(payload(new StringSource("<request/>"))).andRespond(withError("Invalid Request"));
assertThatExceptionOfType(WebServiceTransportException.class).isThrownBy(this.client::test).withMessageContaining("Invalid Request");
}
use of org.springframework.xml.transform.StringSource in project citrus-samples by christophd.
the class FieldForceJmsConsumer method onMessage.
@Override
public void onMessage(Message message) {
try {
if (message instanceof TextMessage) {
OrderNotification notification = (OrderNotification) unmarshaller.unmarshal(new StringSource(((TextMessage) message).getText()));
fieldForceService.process(notification);
}
} catch (JMSException e) {
throw new ServiceException("Failed to convert field force notification message", e);
} catch (IOException e) {
throw new ServiceException("Failed to read field force notification message", e);
}
}
Aggregations