diff --git a/tests/test_output_by_apigroup.tftest.hcl b/tests/test_output_by_apigroup.tftest.hcl index eb120b5..4b01e8b 100644 --- a/tests/test_output_by_apigroup.tftest.hcl +++ b/tests/test_output_by_apigroup.tftest.hcl @@ -16,4 +16,25 @@ run "valida_output_por_apigroup" { condition = length(keys(module.groupResources.groupedResources)) == 1 error_message = "Deveria haver apenas um apigroup: gcp.iam" } + +} + +run "valida_output_por_kind" { + command = plan + variables { + yamls = [ + "tests/fixtures/user.gcp.iam.crd.yaml", + "tests/fixtures/user.gcp.iam.manifest.yaml", + ] + } + + + assert { + condition = length( + keys( + try(module.groupResources.groupedResources["gcp.iam"]["User"], {}) + ) + ) == 2 + error_message = "Não agrupou pelo kind User" + } }