addGroup creates and returns a group in a schema structure
()
| 66 | |
| 67 | // addGroup creates and returns a group in a schema structure |
| 68 | func (testDevFile *TestDevfile) addGroup() *schema.CommandGroup { |
| 69 | |
| 70 | commandGroup := schema.CommandGroup{} |
| 71 | commandGroup.Kind = schema.CommandGroupKind(GetRandomValue(GroupKinds).String()) |
| 72 | LogInfoMessage(fmt.Sprintf("group Kind: %s, default already set %t", commandGroup.Kind, testDevFile.GroupDefaults[commandGroup.Kind])) |
| 73 | // Ensure only one and at least one of each type are labelled as default |
| 74 | if !testDevFile.GroupDefaults[commandGroup.Kind] { |
| 75 | testDevFile.GroupDefaults[commandGroup.Kind] = true |
| 76 | commandGroup.IsDefault = &isTrue |
| 77 | } else { |
| 78 | commandGroup.IsDefault = &isFalse |
| 79 | } |
| 80 | LogInfoMessage(fmt.Sprintf("group isDefault: %t", *commandGroup.IsDefault)) |
| 81 | return &commandGroup |
| 82 | } |
| 83 | |
| 84 | // AddCommand creates a command of a specified type in a schema structure and pupulates it with random attributes |
| 85 | func (testDevFile *TestDevfile) AddCommand(commandType schema.CommandType) schema.Command { |
no test coverage detected