Skip to content

Commit

Permalink
[Upgrade Assistant] Fix getFlatSettings() request (elastic#89616)
Browse files Browse the repository at this point in the history
  • Loading branch information
alisonelizabeth committed Feb 1, 2021
1 parent 75c6e12 commit cbfc354
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ describe('ReindexActions', () => {
});

it('returns null if index does not exist', async () => {
clusterClient.asCurrentUser.indices.getSettings.mockResolvedValueOnce(asApiResponse({}));
clusterClient.asCurrentUser.indices.get.mockResolvedValueOnce(asApiResponse({}));
await expect(actions.getFlatSettings('myIndex')).resolves.toBeNull();
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ describe('reindexService', () => {
});

it('fails if create index is not acknowledged', async () => {
clusterClient.asCurrentUser.indices.getSettings.mockResolvedValueOnce(
clusterClient.asCurrentUser.indices.get.mockResolvedValueOnce(
asApiResponse({ myIndex: settingsMappings })
);

Expand All @@ -898,7 +898,7 @@ describe('reindexService', () => {
});

it('fails if create index fails', async () => {
clusterClient.asCurrentUser.indices.getSettings.mockResolvedValueOnce(
clusterClient.asCurrentUser.indices.get.mockResolvedValueOnce(
asApiResponse({ myIndex: settingsMappings })
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ export default function ({ getService }) {
expect(indexSummary[newIndexName]).to.be.an('object');
// The original index name is aliased to the new one
expect(indexSummary[newIndexName].aliases.dummydata).to.be.an('object');
// Verify mappings exist on new index
expect(indexSummary[newIndexName].mappings.properties).to.be.an('object');
// The number of documents in the new index matches what we expect
expect((await es.count({ index: lastState.newIndexName })).body.count).to.be(3);

Expand Down

0 comments on commit cbfc354

Please sign in to comment.