respondToSdkInit handles the two HTTP requests that the Octopus SDK makes when initialising the system client: fetching the root resource and listing spaces to find the default space.
(t *testing.T, api *testutil.MockHttpServer)
| 16 | // when initialising the system client: fetching the root resource and listing |
| 17 | // spaces to find the default space. |
| 18 | func respondToSdkInit(t *testing.T, api *testutil.MockHttpServer) { |
| 19 | api.ExpectRequest(t, "GET", "/api/").RespondWith(testutil.NewRootResource()) |
| 20 | api.ExpectRequest(t, "GET", "/api/spaces").RespondWith(map[string]any{ |
| 21 | "Items": []any{}, |
| 22 | "ItemsPerPage": 30, |
| 23 | "TotalResults": 0, |
| 24 | }) |
| 25 | } |
| 26 | |
| 27 | func TestApiCommand(t *testing.T) { |
| 28 | tests := []struct { |
no test coverage detected