()
| 658 | } |
| 659 | |
| 660 | func (s *PluginSuite) Test_UpdateConfig_danglingConf_expectNotFound() { |
| 661 | conf := s.getDanglingConf(1) |
| 662 | |
| 663 | newConfig := &mock.PluginConfig{ |
| 664 | TestKey: "test__new__config", |
| 665 | } |
| 666 | newConfigYAML, err := yaml.Marshal(newConfig) |
| 667 | assert.Nil(s.T(), err) |
| 668 | |
| 669 | { |
| 670 | test.WithUser(s.ctx, 1) |
| 671 | |
| 672 | s.ctx.Request = httptest.NewRequest("POST", fmt.Sprintf("/plugin/%d/config", conf.ID), bytes.NewReader(newConfigYAML)) |
| 673 | s.ctx.Header("Content-Type", "application/x-yaml") |
| 674 | s.ctx.Params = gin.Params{{Key: "id", Value: fmt.Sprint(conf.ID)}} |
| 675 | s.a.UpdateConfig(s.ctx) |
| 676 | |
| 677 | assert.Equal(s.T(), 404, s.recorder.Code) |
| 678 | } |
| 679 | } |
| 680 | |
| 681 | func (s *PluginSuite) Test_UpdateConfig_nonExistPlugin_expectNotFound() { |
| 682 | newConfig := &mock.PluginConfig{ |
nothing calls this directly
no test coverage detected