Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Upgrade Assistant] Fix getFlatSettings() request #89616

Merged
merged 6 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ describe('ReindexActions', () => {
} as RequestEvent<T>);

it('returns flat settings', async () => {
clusterClient.asCurrentUser.indices.getSettings.mockResolvedValueOnce(
clusterClient.asCurrentUser.indices.get.mockResolvedValueOnce(
asApiResponse({
myIndex: {
settings: { 'index.mySetting': '1' },
Expand All @@ -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 @@ -236,7 +236,7 @@ export const reindexActionsFactory = (
},

async getFlatSettings(indexName: string) {
const { body: flatSettings } = await esClient.indices.getSettings<{
const { body: flatSettings } = await esClient.indices.get<{
[indexName: string]: FlatSettings;
}>({
index: indexName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,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 @@ -844,7 +844,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