diff --git a/pkg/recipes/terraform/terraform_test.go b/pkg/recipes/terraform/terraform_test.go index e2c9608..e5d4c2c 100644 --- a/pkg/recipes/terraform/terraform_test.go +++ b/pkg/recipes/terraform/terraform_test.go @@ -105,6 +105,11 @@ func Test_DeployFlow(t *testing.T) { // then the user confirmation is expected executor.On("AskUserToConfirm", mock.Anything).Once() + // then the plan json will be created + executor.On("Execute", mock.MatchedBy(func(command string) bool { + return strings.Contains(command, "show -json") && strings.Contains(command, "test.deploy.tfplan") + })).Once() + // then the fully apply is expected executor.On("Execute", mock.MatchedBy(func(command string) bool { return strings.Contains(command, "apply -auto-approve") && strings.Contains(command, "test.deploy.tfplan") @@ -121,6 +126,11 @@ func Test_DeployFlow(t *testing.T) { executor.On("Execute", mock.MatchedBy(func(command string) bool { return strings.Contains(command, "plan -input=false") && strings.Contains(command, "test.deploy.tfplan") })).Once() + + // then the plan json will be created + executor.On("Execute", mock.MatchedBy(func(command string) bool { + return strings.Contains(command, "show -json") && strings.Contains(command, "test.deploy.tfplan") + })).Once() }, true, false,