@@ -14,18 +14,18 @@ import (
1414 "github.com/stretchr/testify/require"
1515)
1616
17- func TestCallWorkerApi (t * testing.T ) {
17+ func TestCallWorkerAPI (t * testing.T ) {
1818 tests := []struct {
1919 name string
2020 stub * ServerStub
21- params ApiCallParams
21+ params APICallParams
2222 ctx model.IntFlagProvider
2323 wantErr string
2424 }{
2525 {
2626 name : "success" ,
2727 stub : NewServerStub (t ).WithGetAllEndpoint (),
28- params : ApiCallParams {
28+ params : APICallParams {
2929 Method : "GET" ,
3030 Path : []string {"workers" },
3131 OkStatuses : []int {http .StatusOK },
@@ -34,7 +34,7 @@ func TestCallWorkerApi(t *testing.T) {
3434 {
3535 name : "unexpected status" ,
3636 stub : NewServerStub (t ).WithGetAllEndpoint (),
37- params : ApiCallParams {
37+ params : APICallParams {
3838 Method : "GET" ,
3939 Path : []string {"workers" },
4040 OkStatuses : []int {http .StatusNoContent },
@@ -44,7 +44,7 @@ func TestCallWorkerApi(t *testing.T) {
4444 {
4545 name : "cancel on timeout" ,
4646 stub : NewServerStub (t ).WithDelay (time .Second ).WithGetAllEndpoint (),
47- params : ApiCallParams {
47+ params : APICallParams {
4848 Method : "GET" ,
4949 Path : []string {"workers" },
5050 OkStatuses : []int {http .StatusNoContent },
@@ -58,7 +58,7 @@ func TestCallWorkerApi(t *testing.T) {
5858 WithGetAllEndpoint ().
5959 WithQueryParam ("a" , "1" ).
6060 WithQueryParam ("b" , "2" ),
61- params : ApiCallParams {
61+ params : APICallParams {
6262 Method : "GET" ,
6363 Path : []string {"workers" },
6464 OkStatuses : []int {http .StatusOK },
@@ -70,7 +70,7 @@ func TestCallWorkerApi(t *testing.T) {
7070 stub : NewServerStub (t ).
7171 WithGetAllEndpoint ().
7272 WithProjectKey ("projectKey" ),
73- params : ApiCallParams {
73+ params : APICallParams {
7474 Method : "GET" ,
7575 Path : []string {"workers" },
7676 OkStatuses : []int {http .StatusOK },
@@ -83,7 +83,7 @@ func TestCallWorkerApi(t *testing.T) {
8383 WithGetAllEndpoint ().
8484 WithQueryParam ("a" , "1" ).
8585 WithProjectKey ("projectKey" ),
86- params : ApiCallParams {
86+ params : APICallParams {
8787 Method : "GET" ,
8888 Path : []string {"workers" },
8989 OkStatuses : []int {http .StatusOK },
@@ -94,7 +94,7 @@ func TestCallWorkerApi(t *testing.T) {
9494 {
9595 name : "process response" ,
9696 stub : NewServerStub (t ).WithGetAllEndpoint ().WithWorkers (& model.WorkerDetails {Key : "wk-0" }),
97- params : ApiCallParams {
97+ params : APICallParams {
9898 Method : "GET" ,
9999 Path : []string {"workers" },
100100 OkStatuses : []int {http .StatusOK },
@@ -120,15 +120,15 @@ func TestCallWorkerApi(t *testing.T) {
120120 t .Run (tt .name , func (t * testing.T ) {
121121 s , token := NewMockWorkerServer (t , tt .stub .WithT (t ))
122122
123- tt .params .ServerUrl = s .BaseUrl ()
123+ tt .params .ServerURL = s .BaseUrl ()
124124 tt .params .ServerToken = token
125125
126126 ctx := tt .ctx
127127 if ctx == nil {
128128 ctx = IntFlagMap {}
129129 }
130130
131- err := CallWorkerApi (ctx , tt .params )
131+ err := CallWorkerAPI (ctx , tt .params )
132132 if tt .wantErr == "" {
133133 assert .NoError (t , err )
134134 } else {
0 commit comments