diff --git a/src/Controller/OData.php b/src/Controller/OData.php index 066e482d2..6af9ed4da 100644 --- a/src/Controller/OData.php +++ b/src/Controller/OData.php @@ -4,6 +4,7 @@ namespace Flat3\Lodata\Controller; +use Flat3\Lodata\Exception\Protocol\ProtocolException; use Flat3\Lodata\Helper\Constants; use Illuminate\Routing\Controller; @@ -24,12 +25,20 @@ public function handle(Request $request, Transaction $transaction, Async $job): { $transaction->initialize($request); - if ($transaction->hasPreference(Constants::respondAsync)) { - $job->setTransaction($transaction); - $job->dispatch(); - } + try { + if ($transaction->hasPreference(Constants::respondAsync)) { + $job->setTransaction($transaction); + $job->dispatch(); + } + + return $transaction->execute(); + } catch (ProtocolException $e) { + if ($e->getHttpCode() < 400) { + return $e->toResponse($request); + } - return $transaction->execute(); + throw $e; + } } /** diff --git a/src/Exception/Protocol/AcceptedException.php b/src/Exception/Protocol/AcceptedException.php index 9046278cf..372e2de6a 100644 --- a/src/Exception/Protocol/AcceptedException.php +++ b/src/Exception/Protocol/AcceptedException.php @@ -15,4 +15,5 @@ class AcceptedException extends ProtocolException protected $httpCode = Response::HTTP_ACCEPTED; protected $odataCode = 'accepted'; protected $message = 'Accepted'; + protected $suppressContent = true; } diff --git a/src/Exception/Protocol/ProtocolException.php b/src/Exception/Protocol/ProtocolException.php index 908265ca3..9a8345e42 100644 --- a/src/Exception/Protocol/ProtocolException.php +++ b/src/Exception/Protocol/ProtocolException.php @@ -158,6 +158,16 @@ public function toError() ]; } + /** + * Get the HTTP Code associated to the exception + * + * @return int + */ + public function getHttpCode(): int + { + return $this->httpCode; + } + /** * Get the original exception that caused this exception * @@ -188,7 +198,9 @@ public function toResponse($request = null): Response $response->setProtocolVersion('1.1'); $response->setStatusCode($this->httpCode); $response->headers->replace($this->headers); - $response->headers->set(Constants::contentType, MediaType::json); + if (!$this->suppressContent) { + $response->headers->set(Constants::contentType, MediaType::json); + } return $response; } diff --git a/tests/Helpers/UseODataAssertions.php b/tests/Helpers/UseODataAssertions.php index 7d1269e7b..839ee192e 100644 --- a/tests/Helpers/UseODataAssertions.php +++ b/tests/Helpers/UseODataAssertions.php @@ -12,7 +12,7 @@ trait UseODataAssertions { protected function assertODataError(Request $request, int $code): TestResponse { - $emptyCodes = [Response::HTTP_NO_CONTENT, Response::HTTP_FOUND, Response::HTTP_NOT_MODIFIED]; + $emptyCodes = [Response::HTTP_ACCEPTED, Response::HTTP_NO_CONTENT, Response::HTTP_FOUND, Response::HTTP_NOT_MODIFIED]; try { $response = $this->req($request); @@ -146,4 +146,4 @@ protected function assertResultCount(TestResponse $response, int $count) { $this->assertEquals($count, count(json_decode($response->streamedContent())->value)); } -} \ No newline at end of file +} diff --git a/tests/__snapshots__/EntitySetCreate/EloquentTest__test_create_return_minimal__1.json b/tests/__snapshots__/EntitySetCreate/EloquentTest__test_create_return_minimal__1.json index 14953aeba..c18df0874 100644 --- a/tests/__snapshots__/EntitySetCreate/EloquentTest__test_create_return_minimal__1.json +++ b/tests/__snapshots__/EntitySetCreate/EloquentTest__test_create_return_minimal__1.json @@ -8,9 +8,6 @@ ], "cache-control": [ "no-cache, private" - ], - "content-type": [ - "application/json" ] }, "status": 204 diff --git a/tests/__snapshots__/EntitySetCreate/FilesystemTest__test_create_return_minimal__1.json b/tests/__snapshots__/EntitySetCreate/FilesystemTest__test_create_return_minimal__1.json index 2e14e3445..63bc62c40 100644 --- a/tests/__snapshots__/EntitySetCreate/FilesystemTest__test_create_return_minimal__1.json +++ b/tests/__snapshots__/EntitySetCreate/FilesystemTest__test_create_return_minimal__1.json @@ -8,9 +8,6 @@ ], "cache-control": [ "no-cache, private" - ], - "content-type": [ - "application/json" ] }, "status": 204 diff --git a/tests/__snapshots__/EntitySetCreate/KeyedCollectionTest__test_create_return_minimal__1.json b/tests/__snapshots__/EntitySetCreate/KeyedCollectionTest__test_create_return_minimal__1.json index 3454dd53a..a9428a9d5 100644 --- a/tests/__snapshots__/EntitySetCreate/KeyedCollectionTest__test_create_return_minimal__1.json +++ b/tests/__snapshots__/EntitySetCreate/KeyedCollectionTest__test_create_return_minimal__1.json @@ -8,9 +8,6 @@ ], "cache-control": [ "no-cache, private" - ], - "content-type": [ - "application/json" ] }, "status": 204 diff --git a/tests/__snapshots__/EntitySetCreate/MongoTest__test_create_return_minimal__1.json b/tests/__snapshots__/EntitySetCreate/MongoTest__test_create_return_minimal__1.json index bafda3138..d5b791ad9 100644 --- a/tests/__snapshots__/EntitySetCreate/MongoTest__test_create_return_minimal__1.json +++ b/tests/__snapshots__/EntitySetCreate/MongoTest__test_create_return_minimal__1.json @@ -8,9 +8,6 @@ ], "cache-control": [ "no-cache, private" - ], - "content-type": [ - "application/json" ] }, "status": 204 diff --git a/tests/__snapshots__/EntitySetCreate/NumericCollectionTest__test_create_return_minimal__1.json b/tests/__snapshots__/EntitySetCreate/NumericCollectionTest__test_create_return_minimal__1.json index ac677dc4e..6e5d45159 100644 --- a/tests/__snapshots__/EntitySetCreate/NumericCollectionTest__test_create_return_minimal__1.json +++ b/tests/__snapshots__/EntitySetCreate/NumericCollectionTest__test_create_return_minimal__1.json @@ -8,9 +8,6 @@ ], "cache-control": [ "no-cache, private" - ], - "content-type": [ - "application/json" ] }, "status": 204 diff --git a/tests/__snapshots__/EntitySetCreate/RedisTest__test_create_return_minimal__1.json b/tests/__snapshots__/EntitySetCreate/RedisTest__test_create_return_minimal__1.json index 3454dd53a..a9428a9d5 100644 --- a/tests/__snapshots__/EntitySetCreate/RedisTest__test_create_return_minimal__1.json +++ b/tests/__snapshots__/EntitySetCreate/RedisTest__test_create_return_minimal__1.json @@ -8,9 +8,6 @@ ], "cache-control": [ "no-cache, private" - ], - "content-type": [ - "application/json" ] }, "status": 204 diff --git a/tests/__snapshots__/EntitySetCreate/SQLTest__test_create_return_minimal__1.json b/tests/__snapshots__/EntitySetCreate/SQLTest__test_create_return_minimal__1.json index d577164b6..9e0feef44 100644 --- a/tests/__snapshots__/EntitySetCreate/SQLTest__test_create_return_minimal__1.json +++ b/tests/__snapshots__/EntitySetCreate/SQLTest__test_create_return_minimal__1.json @@ -8,9 +8,6 @@ ], "cache-control": [ "no-cache, private" - ], - "content-type": [ - "application/json" ] }, "status": 204 diff --git a/tests/__snapshots__/EntityUpdate/EloquentTest__test_update_return_minimal__1.json b/tests/__snapshots__/EntityUpdate/EloquentTest__test_update_return_minimal__1.json index aca146ab6..76b0033a0 100644 --- a/tests/__snapshots__/EntityUpdate/EloquentTest__test_update_return_minimal__1.json +++ b/tests/__snapshots__/EntityUpdate/EloquentTest__test_update_return_minimal__1.json @@ -8,9 +8,6 @@ ], "cache-control": [ "no-cache, private" - ], - "content-type": [ - "application/json" ] }, "status": 204 diff --git a/tests/__snapshots__/EntityUpdate/KeyedCollectionTest__test_update_return_minimal__1.json b/tests/__snapshots__/EntityUpdate/KeyedCollectionTest__test_update_return_minimal__1.json index f3b71e42e..ef8bc0935 100644 --- a/tests/__snapshots__/EntityUpdate/KeyedCollectionTest__test_update_return_minimal__1.json +++ b/tests/__snapshots__/EntityUpdate/KeyedCollectionTest__test_update_return_minimal__1.json @@ -8,9 +8,6 @@ ], "cache-control": [ "no-cache, private" - ], - "content-type": [ - "application/json" ] }, "status": 204 diff --git a/tests/__snapshots__/EntityUpdate/MongoTest__test_update_return_minimal__1.json b/tests/__snapshots__/EntityUpdate/MongoTest__test_update_return_minimal__1.json index f3b71e42e..ef8bc0935 100644 --- a/tests/__snapshots__/EntityUpdate/MongoTest__test_update_return_minimal__1.json +++ b/tests/__snapshots__/EntityUpdate/MongoTest__test_update_return_minimal__1.json @@ -8,9 +8,6 @@ ], "cache-control": [ "no-cache, private" - ], - "content-type": [ - "application/json" ] }, "status": 204 diff --git a/tests/__snapshots__/EntityUpdate/NumericCollectionTest__test_update_return_minimal__1.json b/tests/__snapshots__/EntityUpdate/NumericCollectionTest__test_update_return_minimal__1.json index 209195ce5..d3101f721 100644 --- a/tests/__snapshots__/EntityUpdate/NumericCollectionTest__test_update_return_minimal__1.json +++ b/tests/__snapshots__/EntityUpdate/NumericCollectionTest__test_update_return_minimal__1.json @@ -8,9 +8,6 @@ ], "cache-control": [ "no-cache, private" - ], - "content-type": [ - "application/json" ] }, "status": 204 diff --git a/tests/__snapshots__/EntityUpdate/RedisTest__test_update_return_minimal__1.json b/tests/__snapshots__/EntityUpdate/RedisTest__test_update_return_minimal__1.json index f3b71e42e..ef8bc0935 100644 --- a/tests/__snapshots__/EntityUpdate/RedisTest__test_update_return_minimal__1.json +++ b/tests/__snapshots__/EntityUpdate/RedisTest__test_update_return_minimal__1.json @@ -8,9 +8,6 @@ ], "cache-control": [ "no-cache, private" - ], - "content-type": [ - "application/json" ] }, "status": 204 diff --git a/tests/__snapshots__/EntityUpdate/SQLTest__test_update_return_minimal__1.json b/tests/__snapshots__/EntityUpdate/SQLTest__test_update_return_minimal__1.json index 78818c253..ec551947f 100644 --- a/tests/__snapshots__/EntityUpdate/SQLTest__test_update_return_minimal__1.json +++ b/tests/__snapshots__/EntityUpdate/SQLTest__test_update_return_minimal__1.json @@ -8,9 +8,6 @@ ], "cache-control": [ "no-cache, private" - ], - "content-type": [ - "application/json" ] }, "status": 204 diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async__1.json b/tests/__snapshots__/Protocol/AsyncTest__test_async__1.json index 061c153e5..f625b9516 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async__1.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async__1.json @@ -1,9 +1,11 @@ { - "error": { - "code": "accepted", - "message": "Accepted", - "target": null, - "details": [], - "innererror": {} - } + "headers": { + "location": [ + "http://localhost/odata/_lodata/monitor/00000000-0000-0000-0000-000000000001" + ], + "cache-control": [ + "no-cache, private" + ] + }, + "status": 202 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async__2.json b/tests/__snapshots__/Protocol/AsyncTest__test_async__2.json index 061c153e5..6484c9351 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async__2.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async__2.json @@ -1,9 +1,14 @@ { - "error": { - "code": "accepted", - "message": "Accepted", - "target": null, - "details": [], - "innererror": {} - } + "headers": { + "cache-control": [ + "no-cache, private" + ], + "content-type": [ + "application/json;metadata=minimal" + ], + "odata-version": [ + "4.01" + ] + }, + "status": 200 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async__3.json b/tests/__snapshots__/Protocol/AsyncTest__test_async__3.json index cbc258452..750e02daa 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async__3.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async__3.json @@ -1,14 +1,10 @@ { - "headers": { - "location": [ - "http://localhost/odata/_lodata/monitor/00000000-0000-0000-0000-000000000001" - ], - "cache-control": [ - "no-cache, private" - ], - "content-type": [ - "application/json" - ] - }, - "status": 202 + "@context": "http://localhost/odata/$metadata", + "value": [ + { + "name": "passengers", + "kind": "EntitySet", + "url": "passengers" + } + ] } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async__4.json b/tests/__snapshots__/Protocol/AsyncTest__test_async__4.json index 6484c9351..750e02daa 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async__4.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async__4.json @@ -1,14 +1,10 @@ { - "headers": { - "cache-control": [ - "no-cache, private" - ], - "content-type": [ - "application/json;metadata=minimal" - ], - "odata-version": [ - "4.01" - ] - }, - "status": 200 + "@context": "http://localhost/odata/$metadata", + "value": [ + { + "name": "passengers", + "kind": "EntitySet", + "url": "passengers" + } + ] } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async__5.json b/tests/__snapshots__/Protocol/AsyncTest__test_async__5.json index 750e02daa..165e0c2e7 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async__5.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async__5.json @@ -1,10 +1,17 @@ { - "@context": "http://localhost/odata/$metadata", - "value": [ - { - "name": "passengers", - "kind": "EntitySet", - "url": "passengers" - } - ] + "headers": { + "cache-control": [ + "no-cache, private" + ], + "content-type": [ + "application/json;metadata=minimal" + ], + "odata-version": [ + "4.01" + ], + "asyncresult": [ + "200" + ] + }, + "status": 200 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async__6.json b/tests/__snapshots__/Protocol/AsyncTest__test_async__6.json index 750e02daa..abfb3826f 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async__6.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async__6.json @@ -1,10 +1,9 @@ { - "@context": "http://localhost/odata/$metadata", - "value": [ - { - "name": "passengers", - "kind": "EntitySet", - "url": "passengers" - } - ] + "error": { + "code": "not_found", + "message": "Not found", + "target": null, + "details": [], + "innererror": {} + } } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__1.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__1.json index 061c153e5..f625b9516 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__1.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__1.json @@ -1,9 +1,11 @@ { - "error": { - "code": "accepted", - "message": "Accepted", - "target": null, - "details": [], - "innererror": {} - } + "headers": { + "location": [ + "http://localhost/odata/_lodata/monitor/00000000-0000-0000-0000-000000000001" + ], + "cache-control": [ + "no-cache, private" + ] + }, + "status": 202 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__2.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__2.json index 061c153e5..020300581 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__2.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__2.json @@ -1,9 +1,14 @@ { - "error": { - "code": "accepted", - "message": "Accepted", - "target": null, - "details": [], - "innererror": {} - } + "headers": { + "cache-control": [ + "no-cache, private" + ], + "content-type": [ + "multipart/mixed;boundary=00000000-0000-0000-0000-000000000002" + ], + "odata-version": [ + "4.01" + ] + }, + "status": 200 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__3.txt b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__3.txt new file mode 100644 index 000000000..69c320395 --- /dev/null +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__3.txt @@ -0,0 +1,9 @@ + +--00000000-0000-0000-0000-000000000002 +content-type: application/http + +HTTP/1.1 404 Not Found +content-type: application/json + +{"error":{"code":"no_handler","message":"No route handler was able to process this request","target":null,"details":[],"innererror":{}}} +--00000000-0000-0000-0000-000000000002-- diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__4.txt b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__4.txt new file mode 100644 index 000000000..69c320395 --- /dev/null +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__4.txt @@ -0,0 +1,9 @@ + +--00000000-0000-0000-0000-000000000002 +content-type: application/http + +HTTP/1.1 404 Not Found +content-type: application/json + +{"error":{"code":"no_handler","message":"No route handler was able to process this request","target":null,"details":[],"innererror":{}}} +--00000000-0000-0000-0000-000000000002-- diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__5.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__5.json new file mode 100644 index 000000000..7af4b98d1 --- /dev/null +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__5.json @@ -0,0 +1,17 @@ +{ + "headers": { + "cache-control": [ + "no-cache, private" + ], + "content-type": [ + "multipart/mixed;boundary=00000000-0000-0000-0000-000000000002" + ], + "odata-version": [ + "4.01" + ], + "asyncresult": [ + "200" + ] + }, + "status": 200 +} diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__6.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__6.json new file mode 100644 index 000000000..abfb3826f --- /dev/null +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch__6.json @@ -0,0 +1,9 @@ +{ + "error": { + "code": "not_found", + "message": "Not found", + "target": null, + "details": [], + "innererror": {} + } +} diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__1.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__1.json index 061c153e5..f625b9516 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__1.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__1.json @@ -1,9 +1,11 @@ { - "error": { - "code": "accepted", - "message": "Accepted", - "target": null, - "details": [], - "innererror": {} - } + "headers": { + "location": [ + "http://localhost/odata/_lodata/monitor/00000000-0000-0000-0000-000000000001" + ], + "cache-control": [ + "no-cache, private" + ] + }, + "status": 202 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__2.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__2.json index 061c153e5..eca223c46 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__2.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__2.json @@ -1,9 +1,14 @@ { - "error": { - "code": "accepted", - "message": "Accepted", - "target": null, - "details": [], - "innererror": {} - } + "headers": { + "cache-control": [ + "no-cache, private" + ], + "content-type": [ + "application/json" + ], + "odata-version": [ + "4.01" + ] + }, + "status": 200 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__3.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__3.json index cbc258452..2d2e89fcc 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__3.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__3.json @@ -1,14 +1,20 @@ { - "headers": { - "location": [ - "http://localhost/odata/_lodata/monitor/00000000-0000-0000-0000-000000000001" - ], - "cache-control": [ - "no-cache, private" - ], - "content-type": [ - "application/json" - ] - }, - "status": 202 + "responses": [ + { + "id": 0, + "status": 404, + "headers": { + "content-type": "application/json" + }, + "body": { + "error": { + "code": "no_handler", + "message": "No route handler was able to process this request", + "target": null, + "details": [], + "innererror": {} + } + } + } + ] } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__4.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__4.json index eca223c46..2d2e89fcc 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__4.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__4.json @@ -1,14 +1,20 @@ { - "headers": { - "cache-control": [ - "no-cache, private" - ], - "content-type": [ - "application/json" - ], - "odata-version": [ - "4.01" - ] - }, - "status": 200 + "responses": [ + { + "id": 0, + "status": 404, + "headers": { + "content-type": "application/json" + }, + "body": { + "error": { + "code": "no_handler", + "message": "No route handler was able to process this request", + "target": null, + "details": [], + "innererror": {} + } + } + } + ] } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__5.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__5.json index 2d2e89fcc..bd9ba81fc 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__5.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__5.json @@ -1,20 +1,17 @@ { - "responses": [ - { - "id": 0, - "status": 404, - "headers": { - "content-type": "application/json" - }, - "body": { - "error": { - "code": "no_handler", - "message": "No route handler was able to process this request", - "target": null, - "details": [], - "innererror": {} - } - } - } - ] + "headers": { + "cache-control": [ + "no-cache, private" + ], + "content-type": [ + "application/json" + ], + "odata-version": [ + "4.01" + ], + "asyncresult": [ + "200" + ] + }, + "status": 200 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__6.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__6.json index 2d2e89fcc..abfb3826f 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__6.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_json__6.json @@ -1,20 +1,9 @@ { - "responses": [ - { - "id": 0, - "status": 404, - "headers": { - "content-type": "application/json" - }, - "body": { - "error": { - "code": "no_handler", - "message": "No route handler was able to process this request", - "target": null, - "details": [], - "innererror": {} - } - } - } - ] + "error": { + "code": "not_found", + "message": "Not found", + "target": null, + "details": [], + "innererror": {} + } } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__1.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__1.json index 061c153e5..f625b9516 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__1.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__1.json @@ -1,9 +1,11 @@ { - "error": { - "code": "accepted", - "message": "Accepted", - "target": null, - "details": [], - "innererror": {} - } + "headers": { + "location": [ + "http://localhost/odata/_lodata/monitor/00000000-0000-0000-0000-000000000001" + ], + "cache-control": [ + "no-cache, private" + ] + }, + "status": 202 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__2.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__2.json index 061c153e5..020300581 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__2.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__2.json @@ -1,9 +1,14 @@ { - "error": { - "code": "accepted", - "message": "Accepted", - "target": null, - "details": [], - "innererror": {} - } + "headers": { + "cache-control": [ + "no-cache, private" + ], + "content-type": [ + "multipart/mixed;boundary=00000000-0000-0000-0000-000000000002" + ], + "odata-version": [ + "4.01" + ] + }, + "status": 200 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__3.txt b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__3.txt new file mode 100644 index 000000000..b9aeb1cdb --- /dev/null +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__3.txt @@ -0,0 +1,18 @@ + +--00000000-0000-0000-0000-000000000002 +content-type: application/http + +HTTP/1.0 200 OK +content-type: application/xml + + +application/jsonmultipart/mixedapplication/json;metadata=full;IEEE754Compatible=true;streaming=trueapplication/json;metadata=minimal;IEEE754Compatible=true;streaming=trueapplication/json;metadata=none;IEEE754Compatible=true;streaming=trueapplication/jsonapplication/xml + +--00000000-0000-0000-0000-000000000002 +content-type: application/http + +HTTP/1.0 200 OK +content-type: application/json;metadata=minimal + +{"@context":"http://localhost/odata/$metadata","value":[{"name":"passengers","kind":"EntitySet","url":"passengers"}]} +--00000000-0000-0000-0000-000000000002-- diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__4.txt b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__4.txt new file mode 100644 index 000000000..b9aeb1cdb --- /dev/null +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__4.txt @@ -0,0 +1,18 @@ + +--00000000-0000-0000-0000-000000000002 +content-type: application/http + +HTTP/1.0 200 OK +content-type: application/xml + + +application/jsonmultipart/mixedapplication/json;metadata=full;IEEE754Compatible=true;streaming=trueapplication/json;metadata=minimal;IEEE754Compatible=true;streaming=trueapplication/json;metadata=none;IEEE754Compatible=true;streaming=trueapplication/jsonapplication/xml + +--00000000-0000-0000-0000-000000000002 +content-type: application/http + +HTTP/1.0 200 OK +content-type: application/json;metadata=minimal + +{"@context":"http://localhost/odata/$metadata","value":[{"name":"passengers","kind":"EntitySet","url":"passengers"}]} +--00000000-0000-0000-0000-000000000002-- diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__5.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__5.json new file mode 100644 index 000000000..7af4b98d1 --- /dev/null +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__5.json @@ -0,0 +1,17 @@ +{ + "headers": { + "cache-control": [ + "no-cache, private" + ], + "content-type": [ + "multipart/mixed;boundary=00000000-0000-0000-0000-000000000002" + ], + "odata-version": [ + "4.01" + ], + "asyncresult": [ + "200" + ] + }, + "status": 200 +} diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__6.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__6.json new file mode 100644 index 000000000..abfb3826f --- /dev/null +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_batch_service_metadata__6.json @@ -0,0 +1,9 @@ +{ + "error": { + "code": "not_found", + "message": "Not found", + "target": null, + "details": [], + "innererror": {} + } +} diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__1.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__1.json index 061c153e5..f625b9516 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__1.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__1.json @@ -1,9 +1,11 @@ { - "error": { - "code": "accepted", - "message": "Accepted", - "target": null, - "details": [], - "innererror": {} - } + "headers": { + "location": [ + "http://localhost/odata/_lodata/monitor/00000000-0000-0000-0000-000000000001" + ], + "cache-control": [ + "no-cache, private" + ] + }, + "status": 202 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__2.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__2.json index 061c153e5..b1a11d91f 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__2.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__2.json @@ -1,9 +1,11 @@ { - "error": { - "code": "accepted", - "message": "Accepted", - "target": null, - "details": [], - "innererror": {} - } + "headers": { + "cache-control": [ + "no-cache, private" + ], + "content-type": [ + "application/json" + ] + }, + "status": 404 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__3.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__3.json index cbc258452..d685a2e49 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__3.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__3.json @@ -1,14 +1,9 @@ { - "headers": { - "location": [ - "http://localhost/odata/_lodata/monitor/00000000-0000-0000-0000-000000000001" - ], - "cache-control": [ - "no-cache, private" - ], - "content-type": [ - "application/json" - ] - }, - "status": 202 + "error": { + "code": "no_handler", + "message": "No route handler was able to process this request", + "target": null, + "details": [], + "innererror": {} + } } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__4.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__4.json index b1a11d91f..d685a2e49 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__4.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__4.json @@ -1,11 +1,9 @@ { - "headers": { - "cache-control": [ - "no-cache, private" - ], - "content-type": [ - "application/json" - ] - }, - "status": 404 + "error": { + "code": "no_handler", + "message": "No route handler was able to process this request", + "target": null, + "details": [], + "innererror": {} + } } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__5.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__5.json index d685a2e49..7a313d116 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__5.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__5.json @@ -1,9 +1,14 @@ { - "error": { - "code": "no_handler", - "message": "No route handler was able to process this request", - "target": null, - "details": [], - "innererror": {} - } + "headers": { + "cache-control": [ + "no-cache, private" + ], + "content-type": [ + "application/json" + ], + "asyncresult": [ + "404" + ] + }, + "status": 200 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__6.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__6.json index d685a2e49..abfb3826f 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__6.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_entityset__6.json @@ -1,7 +1,7 @@ { "error": { - "code": "no_handler", - "message": "No route handler was able to process this request", + "code": "not_found", + "message": "Not found", "target": null, "details": [], "innererror": {} diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__1.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__1.json index 061c153e5..f625b9516 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__1.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__1.json @@ -1,9 +1,11 @@ { - "error": { - "code": "accepted", - "message": "Accepted", - "target": null, - "details": [], - "innererror": {} - } + "headers": { + "location": [ + "http://localhost/odata/_lodata/monitor/00000000-0000-0000-0000-000000000001" + ], + "cache-control": [ + "no-cache, private" + ] + }, + "status": 202 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__2.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__2.json index 061c153e5..b1a11d91f 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__2.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__2.json @@ -1,9 +1,11 @@ { - "error": { - "code": "accepted", - "message": "Accepted", - "target": null, - "details": [], - "innererror": {} - } + "headers": { + "cache-control": [ + "no-cache, private" + ], + "content-type": [ + "application/json" + ] + }, + "status": 404 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__3.txt b/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__3.txt new file mode 100644 index 000000000..83f0a3acd --- /dev/null +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__3.txt @@ -0,0 +1 @@ +{"error":{"code":"no_handler","message":"No route handler was able to process this request","target":null,"details":[],"innererror":{}}} \ No newline at end of file diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__4.txt b/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__4.txt new file mode 100644 index 000000000..83f0a3acd --- /dev/null +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__4.txt @@ -0,0 +1 @@ +{"error":{"code":"no_handler","message":"No route handler was able to process this request","target":null,"details":[],"innererror":{}}} \ No newline at end of file diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__5.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__5.json new file mode 100644 index 000000000..7a313d116 --- /dev/null +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__5.json @@ -0,0 +1,14 @@ +{ + "headers": { + "cache-control": [ + "no-cache, private" + ], + "content-type": [ + "application/json" + ], + "asyncresult": [ + "404" + ] + }, + "status": 200 +} diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__6.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__6.json new file mode 100644 index 000000000..abfb3826f --- /dev/null +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_full_metadata__6.json @@ -0,0 +1,9 @@ +{ + "error": { + "code": "not_found", + "message": "Not found", + "target": null, + "details": [], + "innererror": {} + } +} diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__1.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__1.json index 061c153e5..f625b9516 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__1.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__1.json @@ -1,9 +1,11 @@ { - "error": { - "code": "accepted", - "message": "Accepted", - "target": null, - "details": [], - "innererror": {} - } + "headers": { + "location": [ + "http://localhost/odata/_lodata/monitor/00000000-0000-0000-0000-000000000001" + ], + "cache-control": [ + "no-cache, private" + ] + }, + "status": 202 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__2.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__2.json index 061c153e5..982707112 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__2.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__2.json @@ -1,9 +1,14 @@ { - "error": { - "code": "accepted", - "message": "Accepted", - "target": null, - "details": [], - "innererror": {} - } + "headers": { + "cache-control": [ + "no-cache, private" + ], + "content-type": [ + "application/xml" + ], + "odata-version": [ + "4.01" + ] + }, + "status": 200 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__3.txt b/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__3.txt new file mode 100644 index 000000000..e934c052a --- /dev/null +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__3.txt @@ -0,0 +1,2 @@ + +application/jsonmultipart/mixedapplication/json;metadata=full;IEEE754Compatible=true;streaming=trueapplication/json;metadata=minimal;IEEE754Compatible=true;streaming=trueapplication/json;metadata=none;IEEE754Compatible=true;streaming=trueapplication/jsonapplication/xml diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__4.txt b/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__4.txt new file mode 100644 index 000000000..e934c052a --- /dev/null +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__4.txt @@ -0,0 +1,2 @@ + +application/jsonmultipart/mixedapplication/json;metadata=full;IEEE754Compatible=true;streaming=trueapplication/json;metadata=minimal;IEEE754Compatible=true;streaming=trueapplication/json;metadata=none;IEEE754Compatible=true;streaming=trueapplication/jsonapplication/xml diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__5.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__5.json new file mode 100644 index 000000000..5d1244090 --- /dev/null +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__5.json @@ -0,0 +1,17 @@ +{ + "headers": { + "cache-control": [ + "no-cache, private" + ], + "content-type": [ + "application/xml" + ], + "odata-version": [ + "4.01" + ], + "asyncresult": [ + "200" + ] + }, + "status": 200 +} diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__6.json b/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__6.json new file mode 100644 index 000000000..abfb3826f --- /dev/null +++ b/tests/__snapshots__/Protocol/AsyncTest__test_async_metadata__6.json @@ -0,0 +1,9 @@ +{ + "error": { + "code": "not_found", + "message": "Not found", + "target": null, + "details": [], + "innererror": {} + } +} diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_callback__1.json b/tests/__snapshots__/Protocol/AsyncTest__test_callback__1.json index 061c153e5..2d8c8972a 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_callback__1.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_callback__1.json @@ -1,9 +1,17 @@ { - "error": { - "code": "accepted", - "message": "Accepted", - "target": null, - "details": [], - "innererror": {} - } + "headers": { + "location": [ + "http://localhost/odata/_lodata/monitor/00000000-0000-0000-0000-000000000001" + ], + "preference-applied": [ + "callback" + ], + "cache-control": [ + "no-cache, private" + ], + "content-type": [ + "text/html; charset=UTF-8" + ] + }, + "status": 202 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_callback__2.json b/tests/__snapshots__/Protocol/AsyncTest__test_callback__2.json index 60339353c..750e02daa 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_callback__2.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_callback__2.json @@ -1,17 +1,10 @@ { - "headers": { - "location": [ - "http://localhost/odata/_lodata/monitor/00000000-0000-0000-0000-000000000001" - ], - "preference-applied": [ - "callback" - ], - "cache-control": [ - "no-cache, private" - ], - "content-type": [ - "application/json" - ] - }, - "status": 202 + "@context": "http://localhost/odata/$metadata", + "value": [ + { + "name": "passengers", + "kind": "EntitySet", + "url": "passengers" + } + ] } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_callback__3.json b/tests/__snapshots__/Protocol/AsyncTest__test_callback__3.json index 061c153e5..6484c9351 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_callback__3.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_callback__3.json @@ -1,9 +1,14 @@ { - "error": { - "code": "accepted", - "message": "Accepted", - "target": null, - "details": [], - "innererror": {} - } + "headers": { + "cache-control": [ + "no-cache, private" + ], + "content-type": [ + "application/json;metadata=minimal" + ], + "odata-version": [ + "4.01" + ] + }, + "status": 200 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_callback__5.json b/tests/__snapshots__/Protocol/AsyncTest__test_callback__5.json index 6484c9351..165e0c2e7 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_callback__5.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_callback__5.json @@ -8,6 +8,9 @@ ], "odata-version": [ "4.01" + ], + "asyncresult": [ + "200" ] }, "status": 200 diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_callback__6.json b/tests/__snapshots__/Protocol/AsyncTest__test_callback__6.json index 750e02daa..abfb3826f 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_callback__6.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_callback__6.json @@ -1,10 +1,9 @@ { - "@context": "http://localhost/odata/$metadata", - "value": [ - { - "name": "passengers", - "kind": "EntitySet", - "url": "passengers" - } - ] + "error": { + "code": "not_found", + "message": "Not found", + "target": null, + "details": [], + "innererror": {} + } } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_cancellation__1.json b/tests/__snapshots__/Protocol/AsyncTest__test_cancellation__1.json index 061c153e5..be62f3162 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_cancellation__1.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_cancellation__1.json @@ -1,9 +1,14 @@ { - "error": { - "code": "accepted", - "message": "Accepted", - "target": null, - "details": [], - "innererror": {} - } + "headers": { + "location": [ + "http://localhost/odata/_lodata/monitor/00000000-0000-0000-0000-000000000001" + ], + "cache-control": [ + "no-cache, private" + ], + "content-type": [ + "text/html; charset=UTF-8" + ] + }, + "status": 202 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_cancellation__2.json b/tests/__snapshots__/Protocol/AsyncTest__test_cancellation__2.json index cbc258452..9a0199c4c 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_cancellation__2.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_cancellation__2.json @@ -1,14 +1,11 @@ { "headers": { - "location": [ - "http://localhost/odata/_lodata/monitor/00000000-0000-0000-0000-000000000001" + "content-type": [ + "text/html; charset=UTF-8" ], "cache-control": [ "no-cache, private" - ], - "content-type": [ - "application/json" ] }, - "status": 202 + "status": 200 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_cancellation__3.json b/tests/__snapshots__/Protocol/AsyncTest__test_cancellation__3.json index 9a0199c4c..abfb3826f 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_cancellation__3.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_cancellation__3.json @@ -1,11 +1,9 @@ { - "headers": { - "content-type": [ - "text/html; charset=UTF-8" - ], - "cache-control": [ - "no-cache, private" - ] - }, - "status": 200 + "error": { + "code": "not_found", + "message": "Not found", + "target": null, + "details": [], + "innererror": {} + } } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_error__1.json b/tests/__snapshots__/Protocol/AsyncTest__test_error__1.json index 061c153e5..be62f3162 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_error__1.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_error__1.json @@ -1,9 +1,14 @@ { - "error": { - "code": "accepted", - "message": "Accepted", - "target": null, - "details": [], - "innererror": {} - } + "headers": { + "location": [ + "http://localhost/odata/_lodata/monitor/00000000-0000-0000-0000-000000000001" + ], + "cache-control": [ + "no-cache, private" + ], + "content-type": [ + "text/html; charset=UTF-8" + ] + }, + "status": 202 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_error__2.json b/tests/__snapshots__/Protocol/AsyncTest__test_error__2.json index cbc258452..b1a11d91f 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_error__2.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_error__2.json @@ -1,8 +1,5 @@ { "headers": { - "location": [ - "http://localhost/odata/_lodata/monitor/00000000-0000-0000-0000-000000000001" - ], "cache-control": [ "no-cache, private" ], @@ -10,5 +7,5 @@ "application/json" ] }, - "status": 202 + "status": 404 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_error__3.json b/tests/__snapshots__/Protocol/AsyncTest__test_error__3.json index 061c153e5..d685a2e49 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_error__3.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_error__3.json @@ -1,7 +1,7 @@ { "error": { - "code": "accepted", - "message": "Accepted", + "code": "no_handler", + "message": "No route handler was able to process this request", "target": null, "details": [], "innererror": {} diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_error__4.json b/tests/__snapshots__/Protocol/AsyncTest__test_error__4.json index b1a11d91f..7a313d116 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_error__4.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_error__4.json @@ -5,7 +5,10 @@ ], "content-type": [ "application/json" + ], + "asyncresult": [ + "404" ] }, - "status": 404 + "status": 200 } diff --git a/tests/__snapshots__/Protocol/AsyncTest__test_error__5.json b/tests/__snapshots__/Protocol/AsyncTest__test_error__5.json index d685a2e49..abfb3826f 100644 --- a/tests/__snapshots__/Protocol/AsyncTest__test_error__5.json +++ b/tests/__snapshots__/Protocol/AsyncTest__test_error__5.json @@ -1,7 +1,7 @@ { "error": { - "code": "no_handler", - "message": "No route handler was able to process this request", + "code": "not_found", + "message": "Not found", "target": null, "details": [], "innererror": {} diff --git a/tests/__snapshots__/Protocol/BatchJSONTest__test_prefer_minimal__1.json b/tests/__snapshots__/Protocol/BatchJSONTest__test_prefer_minimal__1.json index fa19c22d1..5d19d384c 100644 --- a/tests/__snapshots__/Protocol/BatchJSONTest__test_prefer_minimal__1.json +++ b/tests/__snapshots__/Protocol/BatchJSONTest__test_prefer_minimal__1.json @@ -5,8 +5,7 @@ "status": 204, "headers": { "preference-applied": "return=minimal", - "odata-entityid": "http://localhost/odata/airports(5)", - "content-type": "application/json" + "odata-entityid": "http://localhost/odata/airports(5)" } }, { @@ -14,8 +13,7 @@ "status": 204, "headers": { "preference-applied": "return=minimal", - "odata-entityid": "http://localhost/odata/airports(1)", - "content-type": "application/json" + "odata-entityid": "http://localhost/odata/airports(1)" } } ]