MCPcopy Index your code
hub / github.com/OpenFeign/feign / decodesSoap

Method decodesSoap

soap/src/test/java/feign/soap/SOAPCodecTest.java:234–266  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

232 }
233
234 @Test
235 void decodesSoap() throws Exception {
236 GetPrice mock = new GetPrice();
237 mock.item = new Item();
238 mock.item.value = "Apples";
239
240 String mockSoapEnvelop =
241"""
242<?xml version="1.0" encoding="UTF-8" ?>\
243<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">\
244<SOAP-ENV:Header/>\
245<SOAP-ENV:Body>\
246<GetPrice xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://apihost/schema.xsd">\
247<Item>Apples</Item>\
248</GetPrice>\
249</SOAP-ENV:Body>\
250</SOAP-ENV:Envelope>\
251""";
252
253 Response response =
254 Response.builder()
255 .status(200)
256 .reason("OK")
257 .request(
258 Request.create(HttpMethod.GET, "/api", Collections.emptyMap(), null, Util.UTF_8))
259 .headers(Collections.emptyMap())
260 .body(mockSoapEnvelop, UTF_8)
261 .build();
262
263 SOAPDecoder decoder = new SOAPDecoder(new JAXBContextFactory.Builder().build());
264
265 assertThat(decoder.decode(response, GetPrice.class)).isEqualTo(mock);
266 }
267
268 @Test
269 void decodesSoapWithSchemaOnEnvelope() throws Exception {

Callers

nothing calls this directly

Calls 10

builderMethod · 0.95
createMethod · 0.95
decodeMethod · 0.95
bodyMethod · 0.65
headersMethod · 0.65
buildMethod · 0.45
requestMethod · 0.45
reasonMethod · 0.45
statusMethod · 0.45
assertThatMethod · 0.45

Tested by

no test coverage detected