Deprecate getResponseObject and migrate usages

The method is a convenience wrapper around a utility function for
parsing payloads, there is no particular reason for it to be part of the
GrRestApi interface. It's existence lead to various tests stubbing this
method instead the appropriate fetch, which makes the tests more
artificial and harder to understand.

With this change there is a single utility function that is called from
everywhere that has clearly documented behaviour. The only difference
between old and new versions, is that parsing error results in a
rejected promise, instead of quitely returning null.

Google-Bug-Id: b/297849592
Release-Notes: skip
Change-Id: I34b9e0cae7a4feeb987763396a145da0c04f8deb
diff --git a/polygerrit-ui/app/test/mocks/gr-rest-api_mock.ts b/polygerrit-ui/app/test/mocks/gr-rest-api_mock.ts
index 9aee24b..d8b87cc 100644
--- a/polygerrit-ui/app/test/mocks/gr-rest-api_mock.ts
+++ b/polygerrit-ui/app/test/mocks/gr-rest-api_mock.ts
@@ -61,7 +61,6 @@
   DraftInfo,
 } from '../../types/common';
 import {DiffInfo, DiffPreferencesInfo} from '../../types/diff';
-import {readResponsePayload} from '../../elements/shared/gr-rest-api-interface/gr-rest-apis/gr-rest-api-helper-old';
 import {
   createAccountDetailWithId,
   createChange,
@@ -77,6 +76,7 @@
   createDefaultPreferences,
 } from '../../constants/constants';
 import {ParsedChangeInfo} from '../../types/types';
+import {readJSONResponsePayload} from '../../elements/shared/gr-rest-api-interface/gr-rest-apis/gr-rest-api-helper';
 
 export const grRestApiMock: RestApiService = {
   addAccountEmail(): Promise<Response> {
@@ -402,7 +402,7 @@
     return Promise.resolve([]);
   },
   getResponseObject(response: Response): Promise<ParsedJSON> {
-    return readResponsePayload(response).then(payload => payload.parsed);
+    return readJSONResponsePayload(response).then(payload => payload.parsed);
   },
   getReviewedFiles(): Promise<string[] | undefined> {
     return Promise.resolve([]);