Created
November 21, 2017 20:22
-
-
Save kevholditch/556028624df02caa1d75fa3822d22660 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func Test_ApisGetById(t *testing.T) { | |
apiRequest := &ApiRequest{ | |
Name: "test-" + uuid.NewV4().String(), | |
Hosts: []string{"example.com"}, | |
Uris: []string{"/example"}, | |
Methods: []string{"GET", "POST"}, | |
UpstreamUrl: "http://localhost:4140/testservice", | |
StripUri: true, | |
PreserveHost: true, | |
Retries: 3, | |
UpstreamConnectTimeout: 1000, | |
UpstreamSendTimeout: 2000, | |
UpstreamReadTimeout: 3000, | |
HttpsOnly: true, | |
HttpIfTerminated: true, | |
} | |
apiClient := NewClient(NewDefaultConfig()).Apis() | |
createdApi, err := apiClient.Create(apiRequest) | |
assert.Nil(t, err) | |
assert.NotNil(t, createdApi) | |
result, err := apiClient.GetById(createdApi.Id) | |
assert.Equal(t, createdApi, result) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment