Skip to content

Commit

Permalink
making the mock object local
Browse files Browse the repository at this point in the history
Signed-off-by: Santhosh Gandhe <[email protected]>
  • Loading branch information
san81 committed Nov 20, 2024
1 parent 19b1701 commit 0bbd3d2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ public void testDoExecute_UnableParseResponse(String configFileName) throws Exce
// Arrange
int recordCount = (int) (Math.random() * 100);
List<Record<Event>> records = getSampleEventRecords(recordCount);
InvokeResponse invokeResponse = mock(InvokeResponse.class);


// Mock Buffer to return empty payload
when(invokeResponse.payload()).thenReturn(SdkBytes.fromUtf8String("[{\"key\": \"value\"}]"));
Expand Down Expand Up @@ -534,7 +536,7 @@ public void testConvertLambdaResponseToEvent_ExpectException_when_request_respon
LambdaProcessorConfig lambdaProcessorConfig = createLambdaConfigurationFromYaml(configFile);
LambdaProcessor localLambdaProcessor = new LambdaProcessor(pluginFactory, pluginSetting,
lambdaProcessorConfig, awsCredentialsSupplier, expressionEvaluator);

InvokeResponse invokeResponse = mock(InvokeResponse.class);
// Mock LambdaResponse with a valid payload containing three events
when(invokeResponse.payload()).thenReturn(lambdaReponse);
when(invokeResponse.statusCode()).thenReturn(200); // Success status code
Expand Down

0 comments on commit 0bbd3d2

Please sign in to comment.