-
Notifications
You must be signed in to change notification settings - Fork 917
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Huy Nguyen <[email protected]>
- Loading branch information
Showing
11 changed files
with
93 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
63 changes: 63 additions & 0 deletions
63
src/core/server/config/service/config_store_client/dummy_config_store_client.test.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* | ||
* Copyright OpenSearch Contributors | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { DummyConfigStoreClient } from './dummy_config_store_client'; | ||
|
||
describe('DummyConfigStoreClient', () => { | ||
const expectedResponse = { | ||
body: {}, | ||
statusCode: 200, | ||
headers: {}, | ||
warnings: [], | ||
meta: {}, | ||
}; | ||
const dummyStoreConfigClient = new DummyConfigStoreClient(); | ||
|
||
it('should return empty map for listConfigs', async () => { | ||
const response = await dummyStoreConfigClient.listConfigs(); | ||
expect(response).toMatchObject(new Map()); | ||
}); | ||
|
||
it('should return expectedResponse for bulkCreateConfigs', async () => { | ||
const response = await dummyStoreConfigClient.bulkCreateConfigs({ | ||
configs: [], | ||
}); | ||
expect(response).toMatchObject(expectedResponse); | ||
}); | ||
|
||
it('should return expectedResponse for createConfigs', async () => { | ||
const response = await dummyStoreConfigClient.createConfig({ | ||
config: { | ||
name: 'foo', | ||
updatedConfig: {}, | ||
}, | ||
}); | ||
expect(response).toMatchObject(expectedResponse); | ||
}); | ||
|
||
it('should return expectedResponse for bulkDeleteConfigs', async () => { | ||
const response = await dummyStoreConfigClient.bulkDeleteConfigs({ | ||
paths: [], | ||
}); | ||
expect(response).toMatchObject(expectedResponse); | ||
}); | ||
|
||
it('should return expectedResponse for deleteConfig', async () => { | ||
const response = await dummyStoreConfigClient.deleteConfig({ | ||
pluginConfigPath: 'foo', | ||
}); | ||
expect(response).toMatchObject(expectedResponse); | ||
}); | ||
|
||
it('should return undefined for getConfig', async () => { | ||
const response = await dummyStoreConfigClient.getConfig('foo'); | ||
expect(response).toBeUndefined(); | ||
}); | ||
|
||
it('should return empty for bulkGetConfigs', async () => { | ||
const response = await dummyStoreConfigClient.bulkGetConfigs([]); | ||
expect(response).toMatchObject(new Map()); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters