function checkSingleRequest(oActualRequest, fnSuccess, fnError, iBatchNo, oRequestHandle) {
				var sContentID,
					oExpectedRequest,
					oExpectedResponse,
					mHeaders,
					sMethod = oActualRequest.method,
					oResponse,
					mResponseHeaders,
					sUrl = oActualRequest.requestUri,
					bWaitForResponse = true;

				function checkFinish() {
					if (!that.aRequests.length && !that.iPendingResponses) {
						// give some time to process the response
						setTimeout(that.checkFinish.bind(that, assert), 0);
					}
				}

				function _getResponseMetadata(sRequestUri, iIndex) {
					sRequestUri = sRequestUri.split("?")[0];

					return {
						uri : (iIndex === undefined)
							? sRequestUri
							: sRequestUri + "('~" + iIndex + "~')"
					};
				}

				oActualRequest = Object.assign({}, oActualRequest);
				oActualRequest.headers = Object.assign({}, oActualRequest.headers);
				sContentID = oActualRequest.contentID;

				if (sUrl.startsWith(that.oModel.sServiceUrl)) {
					oActualRequest.requestUri = sUrl.slice(that.oModel.sServiceUrl.length + 1);
				}
				oExpectedRequest = that.consumeExpectedRequest(oActualRequest);

				mHeaders = oActualRequest.headers;
				delete mHeaders["Accept"];
				delete mHeaders["Accept-Language"];
				delete mHeaders["Content-Type"];
				delete mHeaders["DataServiceVersion"];
				delete mHeaders["MaxDataServiceVersion"];
				delete mHeaders["X-Requested-With"];
				delete mHeaders["sap-cancel-on-close"];
				delete mHeaders["sap-contextid-accept"];
				delete oActualRequest["_handle"];
				delete oActualRequest["adjustDeepPath"];
				delete oActualRequest["async"];
				delete oActualRequest["deferred"];
				delete oActualRequest["eventInfo"];
				delete oActualRequest["expandRequest"];
				delete oActualRequest["functionMetadata"];
				delete oActualRequest["functionTarget"];
				delete oActualRequest["password"];
				delete oActualRequest["requestID"];
				delete oActualRequest["updateAggregatedMessages"];
				delete oActualRequest["user"];
				delete oActualRequest["contentID"];
				delete oActualRequest["sideEffects"];
				delete oActualRequest["fnRequest"];
				that.iRequestNo += 1;
				if (oExpectedRequest) {
					if (oExpectedRequest.abortId) {
						oRequestHandle.sExpectedAbortId = oExpectedRequest.abortId;
						that.oAbortHelperMock ??= that.mock(oAbortHelper);
						that.oAbortHelperMock.expects("abortCalled")
							.withExactArgs(oRequestHandle.sExpectedAbortId)
							.never();
						 // abortId must not influence deepEqual(oActualRequest, oExpectedRequest...) below
						delete oExpectedRequest.abortId;
					}
					oExpectedResponse = oExpectedRequest.response;

					if (oExpectedResponse === NO_CONTENT) {
						oResponse = {
							statusCode : 204
						};
					} else if (oExpectedResponse
							&& (oExpectedResponse.statusCode < 200
								|| oExpectedResponse.statusCode >= 300)) {
						oResponse = {
							response : oExpectedResponse
						};
					} else if (oExpectedResponse && typeof oExpectedResponse.then === "function") {
						oResponse = oExpectedResponse;
					} else {
						oResponse = oExpectedResponse && oExpectedResponse.data
							? oExpectedResponse
							: {data : oExpectedResponse, statusCode : 200};

						// oResponse needs __metadata for ODataModel.prototype._getKey
						if (oResponse.data && Array.isArray(oResponse.data.results)) {
							oResponse.data.results.forEach(function (oResponseItem, i) {
								oResponseItem.__metadata = oResponseItem.__metadata
									|| _getResponseMetadata(oExpectedRequest.requestUri, i);
							});
						} else if (oExpectedRequest.method !== "HEAD"
								&& !oExpectedRequest.requestUri.includes("/$count")) {
							oResponse.data.__metadata = oResponse.data.__metadata
								|| _getResponseMetadata(oExpectedRequest.requestUri);
						}
					}

					bWaitForResponse = !(oResponse && typeof oResponse.then === "function");
					delete oExpectedRequest.response;
					mResponseHeaders = oExpectedRequest.responseHeaders;
					delete oExpectedRequest.responseHeaders;

					if (oActualRequest.key && sMethod !== "MERGE"
							&& oActualRequest.headers["x-http-method"] !== "MERGE") {
						that.sTemporaryKey = sContentID
							|| oActualRequest.key.match(rTemporaryKey)[0];

						oExpectedRequest.deepPath = oExpectedRequest.deepPath.replace("~key~",
							that.sTemporaryKey);
						delete oActualRequest["key"];

						if (oExpectedRequest.headers && oExpectedRequest.headers["Content-ID"]) {
							oExpectedRequest.headers["Content-ID"] =
								oExpectedRequest.headers["Content-ID"]
									.replace("~key~", that.sTemporaryKey);
						}
					}
					if (oExpectedRequest.headers && oExpectedRequest.headers["Content-ID"]) {
						oExpectedRequest.headers["Content-ID"] =
							oActualRequest.headers["Content-ID"];
						if (oExpectedResponse.body && oExpectedResponse.statusCode >= 400) {
							oExpectedResponse.body = oExpectedResponse.body.replace("~key~",
								oActualRequest.headers["Content-ID"]);
						}
					} else {
						// ignore content ID if not specified in the expected request
						delete oActualRequest.headers["Content-ID"];
					}
					if (oActualRequest.requestUri.startsWith("$") && sMethod === "GET") {
						oExpectedRequest.requestUri = oExpectedRequest.requestUri.replace("~key~",
							that.sTemporaryKey);
						oExpectedRequest.deepPath = oExpectedRequest.deepPath.replace("~key~",
							that.sTemporaryKey);
					}
					if ("batchNo" in oExpectedRequest) {
						oActualRequest.batchNo = iBatchNo;
					}
					if ("requestNo" in oExpectedRequest) {
						oActualRequest.requestNo = that.iRequestNo;
					}
					if (!("data" in oExpectedRequest) && oActualRequest.data === undefined) {
						delete oActualRequest.data;
					}
					assert.deepEqual(oActualRequest, oExpectedRequest, sMethod + " " + sUrl);
					oResponse.headers = mResponseHeaders || {};
					if (oExpectedRequest.headers["Content-ID"]) {
						oResponse.headers["Content-ID"] = oExpectedRequest.headers["Content-ID"];
					}
				} else {
					assert.ok(false, sMethod + " " + sUrl + " (unexpected)");
					oResponse = {value : []}; // dummy response to avoid further errors
				}

				if (bWaitForResponse) {
					that.iPendingResponses += 1;
				} else {
					checkFinish();
				}

				return Promise.resolve(oResponse).then(function (oResponseBody) {
					if (oResponseBody.statusCode >= 200 && oResponseBody.statusCode < 300) {
						return fnSuccess({}, oResponseBody);
					} else {
						return fnError({message: "HTTP request failed", response: oResponseBody.response});
					}
				}).finally(function () {
					if (bWaitForResponse) {
						that.iPendingResponses -= 1;
					}
					// Waiting may be over after the promise has been handled
					checkFinish();
				});
			}
Checks that the expected request arrived and handles its response. If the status of
the expected request is 2xx, the given success handler is called, otherwise
the given error handler is called. This function can also be used to check requests
within a $batch request. In this case the resulting promise is resolved with the
return value of the given success or error handler.

@param {object} oActualRequest
  The request object
@param {function} fnSuccess
  Success callback function
@param {function} fnError
  Error callback function
@param {number} [iBatchNo]
  The number of the batch to which the request belongs to
@param {object} [oRequestHandle]
  The request handle is returned by checkRequest which may be enhanced with an expected
   <code>abortId</code>
@returns {Promise}
  Returns a Promise resolving with the result of the given success or error callback