()
| 46 | class SOAPCodecTest { |
| 47 | |
| 48 | @Test |
| 49 | void encodesSoap() { |
| 50 | Encoder encoder = |
| 51 | new SOAPEncoder.Builder() |
| 52 | .withJAXBContextFactory(new JAXBContextFactory.Builder().build()) |
| 53 | .build(); |
| 54 | |
| 55 | GetPrice mock = new GetPrice(); |
| 56 | mock.item = new Item(); |
| 57 | mock.item.value = "Apples"; |
| 58 | |
| 59 | RequestTemplate template = new RequestTemplate(); |
| 60 | encoder.encode(mock, GetPrice.class, template); |
| 61 | |
| 62 | String soapEnvelop = |
| 63 | """ |
| 64 | <?xml version="1.0" encoding="UTF-8" ?>\ |
| 65 | <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">\ |
| 66 | <SOAP-ENV:Header/>\ |
| 67 | <SOAP-ENV:Body>\ |
| 68 | <GetPrice>\ |
| 69 | <Item>Apples</Item>\ |
| 70 | </GetPrice>\ |
| 71 | </SOAP-ENV:Body>\ |
| 72 | </SOAP-ENV:Envelope>\ |
| 73 | """; |
| 74 | assertThat(template).hasBody(soapEnvelop); |
| 75 | } |
| 76 | |
| 77 | @Test |
| 78 | void doesntEncodeParameterizedTypes() throws Exception { |
nothing calls this directly
no test coverage detected