OLINGO-906: correcting xml serializer to return correct internal code
This commit is contained in:
parent
92fa7cd62e
commit
979d96c083
|
@ -163,7 +163,7 @@ public class ODataXmlSerializer extends AbstractODataSerializer {
|
|||
|
||||
writer.writeStartElement("error");
|
||||
writer.writeDefaultNamespace(NS_METADATA);
|
||||
writeErrorDetails(String.valueOf(error.getStatusCode()), error.getMessage(), error.getTarget(), writer);
|
||||
writeErrorDetails(String.valueOf(error.getCode()), error.getMessage(), error.getTarget(), writer);
|
||||
if (error.getDetails() != null && !error.getDetails().isEmpty()) {
|
||||
writer.writeStartElement(Constants.ERROR_DETAILS);
|
||||
for (ODataErrorDetail inner : error.getDetails()) {
|
||||
|
|
|
@ -48,7 +48,7 @@ public class ServerErrorXmlSerializerTest {
|
|||
String jsonString = IOUtils.toString(stream);
|
||||
assertEquals("<?xml version='1.0' encoding='UTF-8'?>"
|
||||
+ "<error xmlns=\"http://docs.oasis-open.org/odata/ns/metadata\">"
|
||||
+ "<code>0</code>"
|
||||
+ "<code>Code</code>"
|
||||
+ "<message>ErrorMessage</message>"
|
||||
+ "</error>",
|
||||
jsonString);
|
||||
|
@ -74,7 +74,7 @@ public class ServerErrorXmlSerializerTest {
|
|||
String jsonString = IOUtils.toString(stream);
|
||||
assertEquals("<?xml version='1.0' encoding='UTF-8'?>"
|
||||
+ "<error xmlns=\"http://docs.oasis-open.org/odata/ns/metadata\">"
|
||||
+ "<code>0</code>"
|
||||
+ "<code>code</code>"
|
||||
+ "<message>err message</message>"
|
||||
+ "<target>target</target>"
|
||||
+ "<details>"
|
||||
|
|
Loading…
Reference in New Issue