单元测试用例在 awsStepFunctionsAsyncClient.startExecutionAsync 时通过,但对于 awsStepFunctionsAsyncClient.startExecution 失败
@Test
public void testStateMachineExecutionSuccess(){
IngestionWorkflowMetadata executionInputs = prepareStateMachineInputs();
try{
when(awsStepFunctionsAsyncClient.startExecution(any(StartExecutionRequest.class))).thenReturn(startExecutionResult);
stepFunctionUtility.startExecution(executionInputs);
ArgumentCaptor<StartExecutionRequest> requestCaptor = ArgumentCaptor.forClass(StartExecutionRequest.class);
verify(awsStepFunctionsAsyncClient, times(1)).startExecution(requestCaptor.capture());
Assert.assertEquals(EXPECTED_STEP_FUNCTION_ARN, requestCaptor.getValue().getStateMachineArn());
Assert.assertEquals(EXECUTION_ID, requestCaptor.getValue().getName());
Assert.assertEquals(INPUT_STRING, requestCaptor.getValue().getInput());
} catch (Exception e){ failTheTest(); }
}