Skip to content

Commit

Permalink
fix(test): fix InvokeUnitTest
Browse files Browse the repository at this point in the history
  • Loading branch information
fhussonnois committed Jun 25, 2024
1 parent adb4d89 commit 80abb81
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/test/java/io/kestra/plugin/aws/lambda/InvokeUnitTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import org.mockito.stubbing.Answer;
import io.kestra.core.exceptions.IllegalVariableEvaluationException;
import io.kestra.core.runners.RunContext;
import io.kestra.core.runners.WorkingDir;
import io.kestra.plugin.aws.lambda.Invoke.Output;
import software.amazon.awssdk.core.SdkBytes;
import software.amazon.awssdk.http.SdkHttpResponse;
Expand All @@ -49,11 +50,15 @@ public class InvokeUnitTest {
@Mock(strictness = Strictness.LENIENT)
private Storage storage;

@Mock(strictness = Strictness.LENIENT)
private WorkingDir workingDir;

private File tempFile;

@BeforeEach
public void setUp() throws IOException, IllegalVariableEvaluationException {
given(context.storage()).willReturn(storage);
given(context.workingDir()).willReturn(workingDir);
given(context.workingDir().createTempFile()).willReturn(Files.createTempFile("test", "lambdainvoke"));
given(context.metric(any())).willReturn(context);
given(context.render(anyString())).willAnswer(new Answer<String>() {
Expand Down

0 comments on commit 80abb81

Please sign in to comment.