From ac6b791190b5ef8d367d2d4e1c5db8519712ea79 Mon Sep 17 00:00:00 2001 From: Joshua152 <59714582+Joshua152@users.noreply.github.com> Date: Tue, 19 Dec 2023 12:50:50 -0500 Subject: [PATCH] Issue651 tests (#1046) * Implemented filtering on the ISM eplain API Signed-off-by: Joshua Au * Fixed tests for ExplainRequest Signed-off-by: Joshua Au * Added filtering on query and metadata map Signed-off-by: Joshua Au * Filtered on indexNames in metadata Signed-off-by: Joshua Au * Fixed github workflow check errors Signed-off-by: Joshua Au * Removed debugging comments Signed-off-by: Joshua Au * Updated code styling to make more clear Signed-off-by: Joshua Au * Refactored code to match suggestions Signed-off-by: Joshua Au * Added test case for the ExplainFilter.byMetaData and parse methods Signed-off-by: Joshua Au * Started implementation of explain filter IT Signed-off-by: Joshua Au * Implemented test explain filter method Signed-off-by: Joshua Au * Implemented explain filter test on failure Signed-off-by: Joshua Au * Cleaned up log statements Signed-off-by: Joshua Au * Added explain filter test for success Signed-off-by: Joshua Au * Fixed lint errors Signed-off-by: Joshua Au * Removed policy from index to fix flaky tests Signed-off-by: Joshua Au --------- Signed-off-by: Joshua Au Signed-off-by: bowenlan-amzn Co-authored-by: bowenlan-amzn --- .../indexstatemanagement/IndexStateManagementRestTestCase.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt index ab8e772a2..ddb510488 100644 --- a/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt +++ b/src/test/kotlin/org/opensearch/indexmanagement/indexstatemanagement/IndexStateManagementRestTestCase.kt @@ -476,6 +476,8 @@ abstract class IndexStateManagementRestTestCase : IndexManagementRestTestCase() protected fun ExplainFilter.toHttpEntity(): HttpEntity = StringEntity(toJsonString(), APPLICATION_JSON) + protected fun ExplainFilter.toHttpEntity(): HttpEntity = StringEntity(toJsonString(), ContentType.APPLICATION_JSON) + protected fun ChangePolicy.toHttpEntity(): HttpEntity { var string = "{\"${ChangePolicy.POLICY_ID_FIELD}\":\"$policyID\"," if (state != null) {