(t *testing.T)
| 1335 | } |
| 1336 | |
| 1337 | func TestSystemResourceGet(t *testing.T) { |
| 1338 | name := "rs1" |
| 1339 | rs := &structs.Resource{ |
| 1340 | Name: name, |
| 1341 | Parameters: map[string]string{"hello": "world"}, |
| 1342 | Status: "status,omitempty", |
| 1343 | Type: "type", |
| 1344 | Url: "url", |
| 1345 | Apps: structs.Apps{{Name: "app1"}}, |
| 1346 | } |
| 1347 | s := stdapi.New("api", "api") |
| 1348 | s.Route("GET", fmt.Sprintf("/resources/%s", name), func(c *stdapi.Context) error { |
| 1349 | return c.RenderJSON(rs) |
| 1350 | }) |
| 1351 | |
| 1352 | testServer(t, s, func(c *sdk.Client) { |
| 1353 | got, err := c.SystemResourceGet(name) |
| 1354 | require.NoError(t, err) |
| 1355 | require.Equal(t, rs, got) |
| 1356 | }) |
| 1357 | } |
| 1358 | |
| 1359 | func TestSystemResourceLink(t *testing.T) { |
| 1360 | name := "rs1" |
nothing calls this directly
no test coverage detected