(t *testing.T)
| 1450 | } |
| 1451 | |
| 1452 | func TestSystemResourceUpdate(t *testing.T) { |
| 1453 | rs := &structs.Resource{ |
| 1454 | Name: "name", |
| 1455 | Parameters: map[string]string{"hello": "world"}, |
| 1456 | Status: "status,omitempty", |
| 1457 | Type: "type", |
| 1458 | Url: "url", |
| 1459 | Apps: structs.Apps{{Name: "app1"}}, |
| 1460 | } |
| 1461 | s := stdapi.New("api", "api") |
| 1462 | s.Route("PUT", fmt.Sprintf("/resources/%s", rs.Name), func(c *stdapi.Context) error { |
| 1463 | require.Equal(t, "hello=world", c.Form("parameters")) |
| 1464 | return c.RenderJSON(rs) |
| 1465 | }) |
| 1466 | |
| 1467 | testServer(t, s, func(c *sdk.Client) { |
| 1468 | got, err := c.SystemResourceUpdate(rs.Name, structs.ResourceUpdateOptions{ |
| 1469 | Parameters: rs.Parameters, |
| 1470 | }) |
| 1471 | require.NoError(t, err) |
| 1472 | require.Equal(t, rs, got) |
| 1473 | }) |
| 1474 | } |
| 1475 | |
| 1476 | func TestSystemUpdate(t *testing.T) { |
| 1477 | s := stdapi.New("api", "api") |
nothing calls this directly
no test coverage detected