(t *testing.T)
| 238 | } |
| 239 | |
| 240 | func TestSystemResourceUpdate(t *testing.T) { |
| 241 | testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) { |
| 242 | r1 := fxResource |
| 243 | r2 := structs.Resource{} |
| 244 | opts := structs.ResourceUpdateOptions{ |
| 245 | Parameters: map[string]string{"k1": "v1", "k2": "v2"}, |
| 246 | } |
| 247 | ro := stdsdk.RequestOptions{ |
| 248 | Params: stdsdk.Params{ |
| 249 | "parameters": "k1=v1&k2=v2", |
| 250 | }, |
| 251 | } |
| 252 | p.On("SystemResourceUpdate", "resource1", opts).Return(&r1, nil) |
| 253 | err := c.Put("/resources/resource1", ro, &r2) |
| 254 | require.NoError(t, err) |
| 255 | require.Equal(t, r1, r2) |
| 256 | }) |
| 257 | } |
| 258 | |
| 259 | func TestSystemResourceUpdateError(t *testing.T) { |
| 260 | testServer(t, func(c *stdsdk.Client, p *structs.MockProvider) { |
nothing calls this directly
no test coverage detected