| "github.com/goccy/go-yaml" |
| "github.com/stretchr/testify/assert" |
| "github.com/stretchr/testify/require" |
| // Create Keycloak realms |
| //go:embed tasks/main.yml |
| tasks []map[string]interface{} |
| func TestMain(m *testing.M) { |
| err := yaml.UnmarshalWithOptions(tasksFile, &tasks, yaml.Strict()) |
| func getTaskByName(name string) map[string]interface{} { |
| for _, t := range tasks { |
| func TestCreateKeycloakRealmsTask(t *testing.T) { |
| task := getTaskByName("Create Keycloak realms") |
| assert.Equal(t, true, task["no_log"]) |
| assert.Equal(t, false, task["become"]) |
| func TestCreateKeycloakClientsTask(t *testing.T) { |
| task := getTaskByName("Create Keycloak clients") |
| assert.Equal(t, true, task["no_log"]) |
| assert.Equal(t, false, task["become"]) |