Merge "Bug 1503: RestconfError "data-missing" is error code 404."
authorEd Warnicke <eaw@cisco.com>
Fri, 15 Aug 2014 19:27:38 +0000 (19:27 +0000)
committerGerrit Code Review <gerrit@opendaylight.org>
Fri, 15 Aug 2014 19:27:38 +0000 (19:27 +0000)
opendaylight/md-sal/sal-rest-connector/src/main/java/org/opendaylight/controller/sal/restconf/impl/RestconfError.java
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestconfDocumentedExceptionMapperTest.java
opendaylight/md-sal/sal-rest-connector/src/test/java/org/opendaylight/controller/sal/restconf/impl/test/RestconfErrorTest.java

index ed20bd01a5047e4d746858ff4adde4fe7de0c701..544a144987a68a77f9ec14e3c22d77cf1962fae8 100644 (file)
@@ -62,7 +62,7 @@ public class RestconfError {
         RESOURCE_DENIED("resource-denied", 409 /* Conflict */),
         ROLLBACK_FAILED("rollback-failed", 500 /* INTERNAL_SERVER_ERROR */),
         DATA_EXISTS("data-exists", 409 /* Conflict */),
-        DATA_MISSING("data-missing", 409 /* Conflict */),
+        DATA_MISSING("data-missing", 404 /* Resource Not Found */),
         OPERATION_NOT_SUPPORTED("operation-not-supported", 501 /* Not Implemented */),
         OPERATION_FAILED("operation-failed", 500 /* INTERNAL_SERVER_ERROR */),
         PARTIAL_OPERATION("partial-operation", 500 /* INTERNAL_SERVER_ERROR */),
index b8c0270a61407a8358a741abe2515bc83395ef60..2747b9e264c9391f7e5cf9b8f262bb4f33859c09 100644 (file)
@@ -374,7 +374,7 @@ public class RestconfDocumentedExceptionMapperTest extends JerseyTest {
     public void testToJsonResponseWithDataMissingErrorTag() throws Exception {
 
         testJsonResponse(new RestconfDocumentedException("mock error", ErrorType.PROTOCOL, ErrorTag.DATA_MISSING),
-                Status.CONFLICT, ErrorType.PROTOCOL, ErrorTag.DATA_MISSING, "mock error", null, null);
+                Status.NOT_FOUND, ErrorType.PROTOCOL, ErrorTag.DATA_MISSING, "mock error", null, null);
     }
 
     @Test
@@ -594,7 +594,7 @@ public class RestconfDocumentedExceptionMapperTest extends JerseyTest {
     public void testToXMLResponseWithDataMissingErrorTag() throws Exception {
 
         testXMLResponse(new RestconfDocumentedException("mock error", ErrorType.PROTOCOL, ErrorTag.DATA_MISSING),
-                Status.CONFLICT, ErrorType.PROTOCOL, ErrorTag.DATA_MISSING, "mock error", null, null);
+                Status.NOT_FOUND, ErrorType.PROTOCOL, ErrorTag.DATA_MISSING, "mock error", null, null);
     }
 
     @Test
index 18311104a41f9761dd5bede15965df9625ea061b..010572de968736fabbda746d3ff5c8b101a5c433 100644 (file)
@@ -90,7 +90,7 @@ public class RestconfErrorTest {
         lookUpMap.put("resource-denied", 409);
         lookUpMap.put("rollback-failed", 500);
         lookUpMap.put("data-exists", 409);
-        lookUpMap.put("data-missing", 409);
+        lookUpMap.put("data-missing", 404);
         lookUpMap.put("operation-not-supported", 501);
         lookUpMap.put("operation-failed", 500);
         lookUpMap.put("partial-operation", 500);