@@ -3,7 +3,7 @@ package api
3
3
import (
4
4
"bytes"
5
5
"encoding/json"
6
- "io/ioutil "
6
+ "io"
7
7
"net/http"
8
8
"net/http/httptest"
9
9
"testing"
@@ -50,7 +50,7 @@ func TestAddEnvironmentHandler(t *testing.T) {
50
50
router .Mux .ServeHTTP (w , req )
51
51
52
52
assert .Equal (t , 200 , w .Code )
53
- res , _ := ioutil .ReadAll (w .Body )
53
+ res , _ := io .ReadAll (w .Body )
54
54
projectResult := & sdk.Project {}
55
55
json .Unmarshal (res , & projectResult )
56
56
assert .Equal (t , len (projectResult .Environments ), 1 )
@@ -106,7 +106,7 @@ func TestUpdateEnvironmentHandler(t *testing.T) {
106
106
router .Mux .ServeHTTP (w , req )
107
107
108
108
assert .Equal (t , 200 , w .Code )
109
- res , _ := ioutil .ReadAll (w .Body )
109
+ res , _ := io .ReadAll (w .Body )
110
110
t .Logf (string (res ))
111
111
projectResult := & sdk.Project {}
112
112
json .Unmarshal (res , & projectResult )
@@ -157,7 +157,7 @@ func TestDeleteEnvironmentHandler(t *testing.T) {
157
157
router .Mux .ServeHTTP (w , req )
158
158
159
159
assert .Equal (t , 200 , w .Code )
160
- res , _ := ioutil .ReadAll (w .Body )
160
+ res , _ := io .ReadAll (w .Body )
161
161
projectResult := & sdk.Project {}
162
162
json .Unmarshal (res , & projectResult )
163
163
assert .Equal (t , len (projectResult .Environments ), 0 )
@@ -204,7 +204,7 @@ func TestGetEnvironmentsHandler(t *testing.T) {
204
204
router .Mux .ServeHTTP (w , req )
205
205
206
206
assert .Equal (t , 200 , w .Code )
207
- res , _ := ioutil .ReadAll (w .Body )
207
+ res , _ := io .ReadAll (w .Body )
208
208
envsResults := []sdk.Environment {}
209
209
json .Unmarshal (res , & envsResults )
210
210
assert .Equal (t , len (envsResults ), 1 )
@@ -246,7 +246,7 @@ func TestGetEnvironmentHandler(t *testing.T) {
246
246
router .Mux .ServeHTTP (w , req )
247
247
248
248
assert .Equal (t , 200 , w .Code )
249
- res , _ := ioutil .ReadAll (w .Body )
249
+ res , _ := io .ReadAll (w .Body )
250
250
envResults := sdk.Environment {}
251
251
json .Unmarshal (res , & envResults )
252
252
assert .Equal (t , envResults .Name , "Preproduction" )
0 commit comments