[Upgrade Assistant] Fix getFlatSettings() request (#89616)

This commit is contained in:
Alison Goryachev 2021-02-01 15:36:25 -05:00 committed by GitHub
parent 7b06c13087
commit bae179eb32
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 5 deletions

View file

@ -297,7 +297,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' },
@ -312,7 +312,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();
});
});

View file

@ -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,

View file

@ -832,7 +832,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 })
);
@ -847,7 +847,7 @@ describe('reindexService', () => {
});
it('fails if create index fails', async () => {
clusterClient.asCurrentUser.indices.getSettings.mockResolvedValueOnce(
clusterClient.asCurrentUser.indices.get.mockResolvedValueOnce(
asApiResponse({ myIndex: settingsMappings })
);

View file

@ -71,6 +71,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);