From b3936d95cf9e4292d992114a770775ec19673ca2 Mon Sep 17 00:00:00 2001 From: HenryL27 Date: Tue, 13 Feb 2024 13:02:43 -0800 Subject: [PATCH] fix final feature disablement test. whoops Signed-off-by: HenryL27 --- .../conversation/CreateInteractionTransportActionTests.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/CreateInteractionTransportActionTests.java b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/CreateInteractionTransportActionTests.java index 22ec5ce386..d4cf0a4566 100644 --- a/memory/src/test/java/org/opensearch/ml/memory/action/conversation/CreateInteractionTransportActionTests.java +++ b/memory/src/test/java/org/opensearch/ml/memory/action/conversation/CreateInteractionTransportActionTests.java @@ -227,8 +227,10 @@ public void testDoExecuteFails_thenFail() { } public void testFeatureDisabled_ThenFail() { - when(this.clusterService.getSettings()).thenReturn(Settings.EMPTY); - when(this.clusterService.getClusterSettings()).thenReturn(new ClusterSettings(Settings.EMPTY, Set.of(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED))); + Settings settings = Settings.builder().put(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED.getKey(), false).build(); + when(this.clusterService.getSettings()).thenReturn(settings); + when(this.clusterService.getClusterSettings()) + .thenReturn(new ClusterSettings(settings, Set.of(ConversationalIndexConstants.ML_COMMONS_MEMORY_FEATURE_ENABLED))); this.action = spy(new CreateInteractionTransportAction(transportService, actionFilters, cmHandler, client, clusterService)); action.doExecute(null, request, actionListener);