Skip to content

Commit

Permalink
fixed failing server tests
Browse files Browse the repository at this point in the history
  • Loading branch information
“sneha122” committed Nov 28, 2024
1 parent b5c702f commit f39e6e6
Showing 1 changed file with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,8 @@ private Mono<ActionExecutionResult> executeAction(
Mockito.when(pluginExecutorHelper.getPluginExecutor(any())).thenReturn(Mono.just(pluginExecutor));
Mockito.when(pluginExecutor.executeParameterizedWithMetrics(any(), any(), any(), any(), any()))
.thenReturn(Mono.just(mockResult));
Mockito.when(pluginExecutor.executeParameterizedWithMetricsAndFlags(any(), any(), any(), any(), any(), any()))
.thenReturn(Mono.just(mockResult));
Mockito.when(pluginExecutor.datasourceCreate(any())).thenReturn(Mono.empty());
Mockito.doReturn(Mono.just(false))
.when(spyDatasourceService)
Expand Down Expand Up @@ -527,6 +529,8 @@ public void testActionExecuteErrorResponse() {
Mockito.when(pluginExecutorHelper.getPluginExecutor(any())).thenReturn(Mono.just(pluginExecutor));
Mockito.when(pluginExecutor.executeParameterizedWithMetrics(any(), any(), any(), any(), any()))
.thenReturn(Mono.error(pluginException));
Mockito.when(pluginExecutor.executeParameterizedWithMetricsAndFlags(any(), any(), any(), any(), any(), any()))
.thenReturn(Mono.error(pluginException));
Mockito.when(pluginExecutor.datasourceCreate(any())).thenReturn(Mono.empty());
Mockito.doReturn(Mono.just(false))
.when(spyDatasourceService)
Expand Down Expand Up @@ -584,6 +588,8 @@ public void testActionExecuteNullPaginationParameters() {
Mockito.when(pluginExecutorHelper.getPluginExecutor(any())).thenReturn(Mono.just(pluginExecutor));
Mockito.when(pluginExecutor.executeParameterizedWithMetrics(any(), any(), any(), any(), any()))
.thenReturn(Mono.error(pluginException));
Mockito.when(pluginExecutor.executeParameterizedWithMetricsAndFlags(any(), any(), any(), any(), any(), any()))
.thenReturn(Mono.error(pluginException));
Mockito.when(pluginExecutor.datasourceCreate(any())).thenReturn(Mono.empty());
Mockito.doReturn(Mono.just(false))
.when(spyDatasourceService)
Expand Down Expand Up @@ -635,6 +641,9 @@ public void testActionExecuteSecondaryStaleConnection() {
Mockito.when(pluginExecutor.executeParameterizedWithMetrics(any(), any(), any(), any(), any()))
.thenReturn(Mono.error(new StaleConnectionException()))
.thenReturn(Mono.error(new StaleConnectionException()));
Mockito.when(pluginExecutor.executeParameterizedWithMetricsAndFlags(any(), any(), any(), any(), any(), any()))
.thenReturn(Mono.error(new StaleConnectionException()))
.thenReturn(Mono.error(new StaleConnectionException()));
Mockito.when(pluginExecutor.datasourceCreate(any())).thenReturn(Mono.empty());
Mockito.doReturn(Mono.just(false))
.when(spyDatasourceService)
Expand Down Expand Up @@ -686,6 +695,8 @@ public void testActionExecuteTimeout() {
Mockito.when(pluginExecutorHelper.getPluginExecutor(any())).thenReturn(Mono.just(pluginExecutor));
Mockito.when(pluginExecutor.executeParameterizedWithMetrics(any(), any(), any(), any(), any()))
.thenAnswer(x -> Mono.delay(Duration.ofMillis(1000)).ofType(ActionExecutionResult.class));
Mockito.when(pluginExecutor.executeParameterizedWithMetricsAndFlags(any(), any(), any(), any(), any(), any()))
.thenAnswer(x -> Mono.delay(Duration.ofMillis(1000)).ofType(ActionExecutionResult.class));
Mockito.when(pluginExecutor.datasourceCreate(any())).thenReturn(Mono.empty());
Mockito.doReturn(Mono.just(false))
.when(spyDatasourceService)
Expand Down Expand Up @@ -716,8 +727,9 @@ public void checkRecoveryFromStaleConnections() {

Mockito.when(pluginExecutorHelper.getPluginExecutor(any())).thenReturn(Mono.just(pluginExecutor));
Mockito.when(pluginExecutor.executeParameterizedWithMetrics(any(), any(), any(), any(), any()))
.thenThrow(new StaleConnectionException())
.thenReturn(Mono.just(mockResult));
.thenThrow(new StaleConnectionException());
Mockito.when(pluginExecutor.executeParameterizedWithMetricsAndFlags(any(), any(), any(), any(), any(), any()))
.thenThrow(new StaleConnectionException());
Mockito.when(pluginExecutor.datasourceCreate(any())).thenReturn(Mono.empty());
Mockito.when(pluginExecutor.getHintMessages(any(), any()))
.thenReturn(Mono.zip(Mono.just(new HashSet<>()), Mono.just(new HashSet<>())));
Expand Down

0 comments on commit f39e6e6

Please sign in to comment.