| calledFirstEndpointByCriteria int |
| func (ta *testAccess) FirstEndpointUrlByCriteria(ac ApiCriteria) string { |
| ta.calledFirstEndpointByCriteria++ |
| urls := []string{ta.public, ta.internal} |
| return urls[ac.UrlChoice] |
| func (ta *testAccess) AuthToken() string { |
| func (ta *testAccess) Revoke(string) error { |
| func (ta *testAccess) Reauthenticate() error { |
| func TestGetServersApi(t *testing.T) { |
| c := TestContext().UseCustomClient(&http.Client{Transport: newTransport().WithResponse("Hello")}) |
| public: "http://localhost:8080", |
| internal: "http://localhost:8086", |
| _, err := c.ServersApi(acc, ApiCriteria{ |
| Name: "cloudComputeOpenStack", |
| if acc.calledFirstEndpointByCriteria != 1 { |
| t.Error("Expected FirstEndpointByCriteria to be called") |