@@ -56,15 +56,15 @@ func TestExpTaskDelete(t *testing.T) {
5656 taskID := uuid .MustParse (id1 )
5757 return func (w http.ResponseWriter , r * http.Request ) {
5858 switch {
59- case r .Method == http .MethodGet && r .URL .Path == "/api/experimental /tasks/me/exists" :
59+ case r .Method == http .MethodGet && r .URL .Path == "/api/v2 /tasks/me/exists" :
6060 c .nameResolves .Add (1 )
6161 httpapi .Write (r .Context (), w , http .StatusOK ,
6262 codersdk.Task {
6363 ID : taskID ,
6464 Name : "exists" ,
6565 OwnerName : "me" ,
6666 })
67- case r .Method == http .MethodDelete && r .URL .Path == "/api/experimental /tasks/me/" + id1 :
67+ case r .Method == http .MethodDelete && r .URL .Path == "/api/v2 /tasks/me/" + id1 :
6868 c .deleteCalls .Add (1 )
6969 w .WriteHeader (http .StatusAccepted )
7070 default :
@@ -82,13 +82,13 @@ func TestExpTaskDelete(t *testing.T) {
8282 buildHandler : func (c * testCounters ) http.HandlerFunc {
8383 return func (w http.ResponseWriter , r * http.Request ) {
8484 switch {
85- case r .Method == http .MethodGet && r .URL .Path == "/api/experimental /tasks/me/" + id2 :
85+ case r .Method == http .MethodGet && r .URL .Path == "/api/v2 /tasks/me/" + id2 :
8686 httpapi .Write (r .Context (), w , http .StatusOK , codersdk.Task {
8787 ID : uuid .MustParse (id2 ),
8888 OwnerName : "me" ,
8989 Name : "uuid-task" ,
9090 })
91- case r .Method == http .MethodDelete && r .URL .Path == "/api/experimental /tasks/me/" + id2 :
91+ case r .Method == http .MethodDelete && r .URL .Path == "/api/v2 /tasks/me/" + id2 :
9292 c .deleteCalls .Add (1 )
9393 w .WriteHeader (http .StatusAccepted )
9494 default :
@@ -104,24 +104,24 @@ func TestExpTaskDelete(t *testing.T) {
104104 buildHandler : func (c * testCounters ) http.HandlerFunc {
105105 return func (w http.ResponseWriter , r * http.Request ) {
106106 switch {
107- case r .Method == http .MethodGet && r .URL .Path == "/api/experimental /tasks/me/first" :
107+ case r .Method == http .MethodGet && r .URL .Path == "/api/v2 /tasks/me/first" :
108108 c .nameResolves .Add (1 )
109109 httpapi .Write (r .Context (), w , http .StatusOK , codersdk.Task {
110110 ID : uuid .MustParse (id3 ),
111111 Name : "first" ,
112112 OwnerName : "me" ,
113113 })
114- case r .Method == http .MethodGet && r .URL .Path == "/api/experimental /tasks/me/" + id4 :
114+ case r .Method == http .MethodGet && r .URL .Path == "/api/v2 /tasks/me/" + id4 :
115115 c .nameResolves .Add (1 )
116116 httpapi .Write (r .Context (), w , http .StatusOK , codersdk.Task {
117117 ID : uuid .MustParse (id4 ),
118118 OwnerName : "me" ,
119119 Name : "uuid-task-4" ,
120120 })
121- case r .Method == http .MethodDelete && r .URL .Path == "/api/experimental /tasks/me/" + id3 :
121+ case r .Method == http .MethodDelete && r .URL .Path == "/api/v2 /tasks/me/" + id3 :
122122 c .deleteCalls .Add (1 )
123123 w .WriteHeader (http .StatusAccepted )
124- case r .Method == http .MethodDelete && r .URL .Path == "/api/experimental /tasks/me/" + id4 :
124+ case r .Method == http .MethodDelete && r .URL .Path == "/api/v2 /tasks/me/" + id4 :
125125 c .deleteCalls .Add (1 )
126126 w .WriteHeader (http .StatusAccepted )
127127 default :
@@ -140,7 +140,7 @@ func TestExpTaskDelete(t *testing.T) {
140140 buildHandler : func (_ * testCounters ) http.HandlerFunc {
141141 return func (w http.ResponseWriter , r * http.Request ) {
142142 switch {
143- case r .Method == http .MethodGet && r .URL .Path == "/api/experimental /tasks" && r .URL .Query ().Get ("q" ) == "owner:\" me\" " :
143+ case r .Method == http .MethodGet && r .URL .Path == "/api/v2 /tasks" && r .URL .Query ().Get ("q" ) == "owner:\" me\" " :
144144 httpapi .Write (r .Context (), w , http .StatusOK , struct {
145145 Tasks []codersdk.Task `json:"tasks"`
146146 Count int `json:"count"`
@@ -163,14 +163,14 @@ func TestExpTaskDelete(t *testing.T) {
163163 taskID := uuid .MustParse (id5 )
164164 return func (w http.ResponseWriter , r * http.Request ) {
165165 switch {
166- case r .Method == http .MethodGet && r .URL .Path == "/api/experimental /tasks/me/bad" :
166+ case r .Method == http .MethodGet && r .URL .Path == "/api/v2 /tasks/me/bad" :
167167 c .nameResolves .Add (1 )
168168 httpapi .Write (r .Context (), w , http .StatusOK , codersdk.Task {
169169 ID : taskID ,
170170 Name : "bad" ,
171171 OwnerName : "me" ,
172172 })
173- case r .Method == http .MethodDelete && r .URL .Path == "/api/experimental /tasks/me/bad" :
173+ case r .Method == http .MethodDelete && r .URL .Path == "/api/v2 /tasks/me/bad" :
174174 httpapi .InternalServerError (w , xerrors .New ("boom" ))
175175 default :
176176 httpapi .InternalServerError (w , xerrors .New ("unwanted path: " + r .Method + " " + r .URL .Path ))
0 commit comments