(t *testing.T)
| 224 | } |
| 225 | |
| 226 | func TestGetMetricConfiguration(t *testing.T) { |
| 227 | var ( |
| 228 | target *orchestrator.CertificationTarget |
| 229 | svc *service_orchestrator.Service |
| 230 | |
| 231 | err error |
| 232 | b bytes.Buffer |
| 233 | ) |
| 234 | |
| 235 | svc = service_orchestrator.NewService() |
| 236 | _, err = clitest.RunCLITestFunc(func() bool { |
| 237 | target, err = svc.CreateDefaultCertificationTarget() |
| 238 | assert.NoError(t, err) |
| 239 | // target should be not nil since there are no stored certification targets yet |
| 240 | assert.NotNil(t, target) |
| 241 | |
| 242 | cli.Output = &b |
| 243 | |
| 244 | // create a new target service |
| 245 | target, err = svc.RegisterCertificationTarget(context.TODO(), &orchestrator.RegisterCertificationTargetRequest{CertificationTarget: &orchestrator.CertificationTarget{Name: "myTarget"}}) |
| 246 | |
| 247 | assert.NotNil(t, target) |
| 248 | assert.NoError(t, err) |
| 249 | |
| 250 | cmd := NewGetMetricConfigurationCommand() |
| 251 | err = cmd.RunE(nil, []string{target.Id, "TransportEncryptionEnabled"}) |
| 252 | |
| 253 | return assert.NoError(t, err) |
| 254 | }, server.WithServices(svc)) |
| 255 | assert.NoError(t, err) |
| 256 | } |
nothing calls this directly
no test coverage detected