Skip to content

Commit 909bdf0

Browse files
committed
Remove https in tests
As this breaks tests when we remove `testutil`, for a reason not yet understood.
1 parent 8ae8293 commit 909bdf0

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

oapi_validate_test.go

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -115,30 +115,30 @@ func TestOapiRequestValidator(t *testing.T) {
115115

116116
// Let's send the request to the wrong server, this should fail validation
117117
{
118-
res := doGet(t, i, "https://not.deepmap.ai/resource")
118+
res := doGet(t, i, "http://not.deepmap.ai/resource")
119119
assert.Equal(t, http.StatusBadRequest, res.Code)
120120
assert.False(t, called, "Handler should not have been called")
121121
}
122122

123123
// Let's send a good request, it should pass
124124
{
125-
res := doGet(t, i, "https://deepmap.ai/resource")
125+
res := doGet(t, i, "http://deepmap.ai/resource")
126126
assert.Equal(t, http.StatusOK, res.Code)
127127
assert.True(t, called, "Handler should have been called")
128128
called = false
129129
}
130130

131131
// Send an out-of-spec parameter
132132
{
133-
res := doGet(t, i, "https://deepmap.ai/resource?id=500")
133+
res := doGet(t, i, "http://deepmap.ai/resource?id=500")
134134
assert.Equal(t, http.StatusBadRequest, res.Code)
135135
assert.False(t, called, "Handler should not have been called")
136136
called = false
137137
}
138138

139139
// Send a bad parameter type
140140
{
141-
res := doGet(t, i, "https://deepmap.ai/resource?id=foo")
141+
res := doGet(t, i, "http://deepmap.ai/resource?id=foo")
142142
assert.Equal(t, http.StatusBadRequest, res.Code)
143143
assert.False(t, called, "Handler should not have been called")
144144
called = false
@@ -152,7 +152,7 @@ func TestOapiRequestValidator(t *testing.T) {
152152
}{
153153
Name: "Marcin",
154154
}
155-
res := doPost(t, i, "https://deepmap.ai/resource", body)
155+
res := doPost(t, i, "http://deepmap.ai/resource", body)
156156
assert.Equal(t, http.StatusNoContent, res.Code)
157157
assert.True(t, called, "Handler should have been called")
158158
called = false
@@ -165,31 +165,31 @@ func TestOapiRequestValidator(t *testing.T) {
165165
}{
166166
Name: 7,
167167
}
168-
res := doPost(t, i, "https://deepmap.ai/resource", body)
168+
res := doPost(t, i, "http://deepmap.ai/resource", body)
169169
assert.Equal(t, http.StatusBadRequest, res.Code)
170170
assert.False(t, called, "Handler should not have been called")
171171
called = false
172172
}
173173

174174
// Call a protected function to which we have access
175175
{
176-
res := doGet(t, i, "https://deepmap.ai/protected_resource")
176+
res := doGet(t, i, "http://deepmap.ai/protected_resource")
177177
assert.Equal(t, http.StatusNoContent, res.Code)
178178
assert.True(t, called, "Handler should have been called")
179179
called = false
180180
}
181181

182182
// Call a protected function to which we don't have access
183183
{
184-
res := doGet(t, i, "https://deepmap.ai/protected_resource2")
184+
res := doGet(t, i, "http://deepmap.ai/protected_resource2")
185185
assert.Equal(t, http.StatusBadRequest, res.Code)
186186
assert.False(t, called, "Handler should not have been called")
187187
called = false
188188
}
189189

190190
// Call a protected function without credentials
191191
{
192-
res := doGet(t, i, "https://deepmap.ai/protected_resource_401")
192+
res := doGet(t, i, "http://deepmap.ai/protected_resource_401")
193193
assert.Equal(t, http.StatusBadRequest, res.Code)
194194
body, err := io.ReadAll(res.Body)
195195
if assert.NoError(t, err) {
@@ -234,7 +234,7 @@ func TestOapiRequestValidatorWithOptionsMultiError(t *testing.T) {
234234

235235
// Let's send a good request, it should pass
236236
{
237-
res := doGet(t, i, "https://deepmap.ai/multiparamresource?id=50&id2=50")
237+
res := doGet(t, i, "http://deepmap.ai/multiparamresource?id=50&id2=50")
238238
assert.Equal(t, http.StatusOK, res.Code)
239239
assert.True(t, called, "Handler should have been called")
240240
called = false
@@ -243,7 +243,7 @@ func TestOapiRequestValidatorWithOptionsMultiError(t *testing.T) {
243243
// Let's send a request with a missing parameter, it should return
244244
// a bad status
245245
{
246-
res := doGet(t, i, "https://deepmap.ai/multiparamresource?id=50")
246+
res := doGet(t, i, "http://deepmap.ai/multiparamresource?id=50")
247247
assert.Equal(t, http.StatusBadRequest, res.Code)
248248
body, err := io.ReadAll(res.Body)
249249
if assert.NoError(t, err) {
@@ -258,7 +258,7 @@ func TestOapiRequestValidatorWithOptionsMultiError(t *testing.T) {
258258
// Let's send a request with a 2 missing parameters, it should return
259259
// a bad status
260260
{
261-
res := doGet(t, i, "https://deepmap.ai/multiparamresource")
261+
res := doGet(t, i, "http://deepmap.ai/multiparamresource")
262262
assert.Equal(t, http.StatusBadRequest, res.Code)
263263
body, err := io.ReadAll(res.Body)
264264
if assert.NoError(t, err) {
@@ -275,7 +275,7 @@ func TestOapiRequestValidatorWithOptionsMultiError(t *testing.T) {
275275
// Let's send a request with a 1 missing parameter, and another outside
276276
// or the parameters. It should return a bad status
277277
{
278-
res := doGet(t, i, "https://deepmap.ai/multiparamresource?id=500")
278+
res := doGet(t, i, "http://deepmap.ai/multiparamresource?id=500")
279279
assert.Equal(t, http.StatusBadRequest, res.Code)
280280
body, err := io.ReadAll(res.Body)
281281
if assert.NoError(t, err) {
@@ -292,7 +292,7 @@ func TestOapiRequestValidatorWithOptionsMultiError(t *testing.T) {
292292
// Let's send a request with a parameters that do not meet spec. It should
293293
// return a bad status
294294
{
295-
res := doGet(t, i, "https://deepmap.ai/multiparamresource?id=abc&id2=1")
295+
res := doGet(t, i, "http://deepmap.ai/multiparamresource?id=abc&id2=1")
296296
assert.Equal(t, http.StatusBadRequest, res.Code)
297297
body, err := io.ReadAll(res.Body)
298298
if assert.NoError(t, err) {
@@ -344,7 +344,7 @@ func TestOapiRequestValidatorWithOptionsMultiErrorAndCustomHandler(t *testing.T)
344344

345345
// Let's send a good request, it should pass
346346
{
347-
res := doGet(t, i, "https://deepmap.ai/multiparamresource?id=50&id2=50")
347+
res := doGet(t, i, "http://deepmap.ai/multiparamresource?id=50&id2=50")
348348
assert.Equal(t, http.StatusOK, res.Code)
349349
assert.True(t, called, "Handler should have been called")
350350
called = false
@@ -353,7 +353,7 @@ func TestOapiRequestValidatorWithOptionsMultiErrorAndCustomHandler(t *testing.T)
353353
// Let's send a request with a missing parameter, it should return
354354
// a bad status
355355
{
356-
res := doGet(t, i, "https://deepmap.ai/multiparamresource?id=50")
356+
res := doGet(t, i, "http://deepmap.ai/multiparamresource?id=50")
357357
assert.Equal(t, http.StatusBadRequest, res.Code)
358358
body, err := io.ReadAll(res.Body)
359359
if assert.NoError(t, err) {
@@ -368,7 +368,7 @@ func TestOapiRequestValidatorWithOptionsMultiErrorAndCustomHandler(t *testing.T)
368368
// Let's send a request with a 2 missing parameters, it should return
369369
// a bad status
370370
{
371-
res := doGet(t, i, "https://deepmap.ai/multiparamresource")
371+
res := doGet(t, i, "http://deepmap.ai/multiparamresource")
372372
assert.Equal(t, http.StatusBadRequest, res.Code)
373373
body, err := io.ReadAll(res.Body)
374374
if assert.NoError(t, err) {
@@ -385,7 +385,7 @@ func TestOapiRequestValidatorWithOptionsMultiErrorAndCustomHandler(t *testing.T)
385385
// Let's send a request with a 1 missing parameter, and another outside
386386
// or the parameters. It should return a bad status
387387
{
388-
res := doGet(t, i, "https://deepmap.ai/multiparamresource?id=500")
388+
res := doGet(t, i, "http://deepmap.ai/multiparamresource?id=500")
389389
assert.Equal(t, http.StatusBadRequest, res.Code)
390390
body, err := io.ReadAll(res.Body)
391391
if assert.NoError(t, err) {
@@ -402,7 +402,7 @@ func TestOapiRequestValidatorWithOptionsMultiErrorAndCustomHandler(t *testing.T)
402402
// Let's send a request with a parameters that do not meet spec. It should
403403
// return a bad status
404404
{
405-
res := doGet(t, i, "https://deepmap.ai/multiparamresource?id=abc&id2=1")
405+
res := doGet(t, i, "http://deepmap.ai/multiparamresource?id=abc&id2=1")
406406
assert.Equal(t, http.StatusBadRequest, res.Code)
407407
body, err := io.ReadAll(res.Body)
408408
if assert.NoError(t, err) {

0 commit comments

Comments
 (0)