INTSAMPLES-26 Use Payload and Header Matchers in Tests

This commit is contained in:
Gary Russell
2011-07-26 17:40:38 +05:30
parent 94ea8d35ea
commit 37ae292151
9 changed files with 35 additions and 32 deletions

View File

@@ -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 {

View File

@@ -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/");
}