Skip to content

Commit

Permalink
Add "mix of schemes configured including supported ones with https"
Browse files Browse the repository at this point in the history
Signed-off-by: jchampne <jchampne@opendns.com>
  • Loading branch information
jchampne committed Jul 23, 2019
1 parent f8776c9 commit c5be074
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions openapi/openapi_v2_backend_configuration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -572,14 +572,11 @@ func TestGetHTTPSchemes(t *testing.T) {
expectedError string
}{
{name: "both http and https schemes are configured", inputSchemes: []string{"http", "https"}, expectedScheme: "https"},
{name: "mix of schemes configured including supported ones", inputSchemes: []string{"http", "ws"}, expectedScheme: "http"},
{name: "mix of schemes configured including supported ones without https", inputSchemes: []string{"http", "ws"}, expectedScheme: "http"},
{name: "mix of schemes configured including supported ones with https", inputSchemes: []string{"http", "ws", "https"}, expectedScheme: "https"},
{name: "none http or https schemes are configured", inputSchemes: []string{}, expectedError: "no schemes specified - must use http or https"},
{name: "none of the schemes configured are supported", inputSchemes: []string{"ws"}, expectedError: "specified schemes [ws] are not supported - must use http or https"},
}

// TODO: add missing use cases
// - inputSchemes: []string{"http", "ws", "https"}

for _, tc := range testCases {
Convey(fmt.Sprintf("Given a specV2BackendConfiguration with %s", tc.name), t, func() {
spec := &spec.Swagger{
Expand Down

0 comments on commit c5be074

Please sign in to comment.