@@ -56,15 +56,15 @@ func TestExpTaskDelete(t *testing.T) {
5656taskID := uuid .MustParse (id1 )
5757return func (w http.ResponseWriter ,r * http.Request ) {
5858switch {
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" :
6060c .nameResolves .Add (1 )
6161httpapi .Write (r .Context (),w ,http .StatusOK ,
6262codersdk.Task {
6363ID :taskID ,
6464Name :"exists" ,
6565OwnerName :"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 :
6868c .deleteCalls .Add (1 )
6969w .WriteHeader (http .StatusAccepted )
7070default :
@@ -82,13 +82,13 @@ func TestExpTaskDelete(t *testing.T) {
8282buildHandler :func (c * testCounters ) http.HandlerFunc {
8383return func (w http.ResponseWriter ,r * http.Request ) {
8484switch {
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 :
8686httpapi .Write (r .Context (),w ,http .StatusOK , codersdk.Task {
8787ID :uuid .MustParse (id2 ),
8888OwnerName :"me" ,
8989Name :"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 :
9292c .deleteCalls .Add (1 )
9393w .WriteHeader (http .StatusAccepted )
9494default :
@@ -104,24 +104,24 @@ func TestExpTaskDelete(t *testing.T) {
104104buildHandler :func (c * testCounters ) http.HandlerFunc {
105105return func (w http.ResponseWriter ,r * http.Request ) {
106106switch {
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" :
108108c .nameResolves .Add (1 )
109109httpapi .Write (r .Context (),w ,http .StatusOK , codersdk.Task {
110110ID :uuid .MustParse (id3 ),
111111Name :"first" ,
112112OwnerName :"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 :
115115c .nameResolves .Add (1 )
116116httpapi .Write (r .Context (),w ,http .StatusOK , codersdk.Task {
117117ID :uuid .MustParse (id4 ),
118118OwnerName :"me" ,
119119Name :"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 :
122122c .deleteCalls .Add (1 )
123123w .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 :
125125c .deleteCalls .Add (1 )
126126w .WriteHeader (http .StatusAccepted )
127127default :
@@ -140,7 +140,7 @@ func TestExpTaskDelete(t *testing.T) {
140140buildHandler :func (_ * testCounters ) http.HandlerFunc {
141141return func (w http.ResponseWriter ,r * http.Request ) {
142142switch {
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\" " :
144144httpapi .Write (r .Context (),w ,http .StatusOK ,struct {
145145Tasks []codersdk.Task `json:"tasks"`
146146Count int `json:"count"`
@@ -163,14 +163,14 @@ func TestExpTaskDelete(t *testing.T) {
163163taskID := uuid .MustParse (id5 )
164164return func (w http.ResponseWriter ,r * http.Request ) {
165165switch {
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" :
167167c .nameResolves .Add (1 )
168168httpapi .Write (r .Context (),w ,http .StatusOK , codersdk.Task {
169169ID :taskID ,
170170Name :"bad" ,
171171OwnerName :"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" :
174174httpapi .InternalServerError (w ,xerrors .New ("boom" ))
175175default :
176176httpapi .InternalServerError (w ,xerrors .New ("unwanted path: " + r .Method + " " + r .URL .Path ))