ExecuteRegionFunction66 extends BaseCommand { void executeFunctionWithResult(Object function, byte functionState, Function<?> functionObject, AbstractExecution execution) { if (function instanceof String) { switch (functionState) { case AbstractExecution.NO_HA_HASRESULT_NO_OPTIMIZEFORWRITE: execution.execute((String) function).getResult(); break; case AbstractExecution.HA_HASRESULT_NO_OPTIMIZEFORWRITE: execution.execute((String) function).getResult(); break; case AbstractExecution.HA_HASRESULT_OPTIMIZEFORWRITE: execution.execute((String) function).getResult(); break; case AbstractExecution.NO_HA_HASRESULT_OPTIMIZEFORWRITE: execution.execute((String) function).getResult(); break; } } else { execution.execute(functionObject).getResult(); } } ExecuteRegionFunction66(); static Command getCommand(); @Override void cmdExecute(final Message clientMessage, final ServerConnection serverConnection,
      final SecurityService securityService, long start);  }
@Test public void executingFunctionInPreGeode18ByStringWithNoHAShouldNotSetWaitOnException() { AbstractExecution execution = mock(AbstractExecution.class); String functionName = "functionName"; when(execution.execute(functionName)).thenReturn(mock(ResultCollector.class)); this.executeRegionFunction66.executeFunctionWithResult(functionName, AbstractExecution.NO_HA_HASRESULT_NO_OPTIMIZEFORWRITE, functionObject, execution); verify(execution, times(0)).setWaitOnExceptionFlag(true); }
@Test public void executingFunctionInPreGeode18ByStringWithNoHAWithOptimizeForWriteShouldNotSetWaitOnException() { AbstractExecution execution = mock(AbstractExecution.class); String functionName = "functionName"; when(execution.execute(functionName)).thenReturn(mock(ResultCollector.class)); this.executeRegionFunction66.executeFunctionWithResult(functionName, AbstractExecution.NO_HA_HASRESULT_OPTIMIZEFORWRITE, functionObject, execution); verify(execution, times(0)).setWaitOnExceptionFlag(true); }
@Test public void executingFunctionObjectInPreGeode18ShouldNotSetWaitOnException() { AbstractExecution execution = mock(AbstractExecution.class); when(execution.execute(functionObject)).thenReturn(mock(ResultCollector.class)); this.executeRegionFunction66.executeFunctionWithResult(functionObject, AbstractExecution.NO_HA_HASRESULT_OPTIMIZEFORWRITE, functionObject, execution); verify(execution, times(0)).setWaitOnExceptionFlag(true); }