INTSAMPLES-26 Use Payload and Header Matchers in Tests
This commit is contained in:
@@ -42,22 +42,18 @@ import org.w3c.dom.Node;
|
||||
public class TrafficHttpConverter implements HttpMessageConverter<Traffic> {
|
||||
private List<MediaType> supportedMediaTypes = Collections.emptyList();
|
||||
|
||||
@Override
|
||||
public boolean canRead(Class<?> clazz, MediaType mediaType) {
|
||||
return Traffic.class.equals(clazz);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canWrite(Class<?> clazz, MediaType mediaType) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<MediaType> getSupportedMediaTypes() {
|
||||
return supportedMediaTypes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Traffic read(Class<? extends Traffic> clazz, HttpInputMessage inputMessage) throws IOException,
|
||||
HttpMessageNotReadableException {
|
||||
Traffic traffic = new Traffic();
|
||||
@@ -79,7 +75,6 @@ public class TrafficHttpConverter implements HttpMessageConverter<Traffic> {
|
||||
return traffic;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void write(Traffic t, MediaType contentType,
|
||||
HttpOutputMessage outputMessage) throws IOException,
|
||||
HttpMessageNotWritableException {
|
||||
|
||||
@@ -48,7 +48,6 @@ public class WeatherMarshaller implements Marshaller, Unmarshaller, Initializing
|
||||
private Map<String, String> namespacePrefixes = new HashMap<String, String>();
|
||||
private String xpathPrefix = "/p:GetCityWeatherByZIPResponse/p:GetCityWeatherByZIPResult/";
|
||||
|
||||
@Override
|
||||
public Object unmarshal(Source source) throws IOException, XmlMappingException {
|
||||
|
||||
//this.writeXml(((DOMSource)source).getNode().getOwnerDocument());
|
||||
@@ -76,13 +75,11 @@ public class WeatherMarshaller implements Marshaller, Unmarshaller, Initializing
|
||||
return weather;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean supports(Class<?> clazz) {
|
||||
System.out.println("Suppors");
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void marshal(Object zip, Result result) throws IOException,
|
||||
XmlMappingException {
|
||||
String xmlString = "<weat:GetCityWeatherByZIP xmlns:weat=\"http://ws.cdyne.com/WeatherWS/\">" +
|
||||
@@ -124,7 +121,6 @@ public class WeatherMarshaller implements Marshaller, Unmarshaller, Initializing
|
||||
return xformer;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
namespacePrefixes.put("p", "http://ws.cdyne.com/WeatherWS/");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user