diff --git a/internal/pkg/client/tempo/tempo.go b/internal/pkg/client/tempo/tempo.go index f9a2f91..a0d4b19 100644 --- a/internal/pkg/client/tempo/tempo.go +++ b/internal/pkg/client/tempo/tempo.go @@ -14,10 +14,10 @@ import ( ) const ( - // WorklogCreatePath is the endpoint used to create new worklogs. - WorklogCreatePath string = "/rest/tempo-timesheets/4/worklogs" - // WorklogSearchPath is the endpoint used to search existing worklogs. - WorklogSearchPath string = "/rest/tempo-timesheets/4/worklogs/search" + // PathWorklogCreate is the endpoint used to create new worklogs. + PathWorklogCreate string = "/rest/tempo-timesheets/4/worklogs" + // PathWorklogSearch is the endpoint used to search existing worklogs. + PathWorklogSearch string = "/rest/tempo-timesheets/4/worklogs/search" ) // Issue represents the Jira issue the time logged against. @@ -78,7 +78,7 @@ func (c *tempoClient) FetchEntries(ctx context.Context, opts *client.FetchOpts) Worker: opts.User, } - resp, err := client.SendRequest(ctx, http.MethodPost, WorklogSearchPath, searchParams, &c.opts.HTTPClientOptions) + resp, err := client.SendRequest(ctx, http.MethodPost, PathWorklogSearch, searchParams, &c.opts.HTTPClientOptions) if err != nil { return nil, fmt.Errorf("%v: %v", client.ErrFetchEntries, err) } @@ -140,7 +140,7 @@ func (c *tempoClient) uploadEntry(ctx context.Context, item worklog.Entry, opts Worker: opts.User, } - if _, err := client.SendRequest(ctx, http.MethodPost, WorklogCreatePath, entry, &c.opts.HTTPClientOptions); err != nil { + if _, err := client.SendRequest(ctx, http.MethodPost, PathWorklogCreate, entry, &c.opts.HTTPClientOptions); err != nil { errChan <- err return } diff --git a/internal/pkg/client/tempo/tempo_test.go b/internal/pkg/client/tempo/tempo_test.go index 7aaca6c..00b9b1b 100644 --- a/internal/pkg/client/tempo/tempo_test.go +++ b/internal/pkg/client/tempo/tempo_test.go @@ -177,7 +177,7 @@ func TestTempoClient_FetchEntries(t *testing.T) { } mockServer := newMockServer(t, &mockServerOpts{ - Path: tempo.WorklogSearchPath, + Path: tempo.PathWorklogSearch, Method: http.MethodPost, StatusCode: http.StatusOK, Username: clientUsername, @@ -328,7 +328,7 @@ func TestTempoClient_UploadEntries(t *testing.T) { } mockServer := newMockServer(t, &mockServerOpts{ - Path: tempo.WorklogCreatePath, + Path: tempo.PathWorklogCreate, Method: http.MethodPost, StatusCode: http.StatusOK, Username: clientUsername, @@ -421,7 +421,7 @@ func TestTempoClient_UploadEntries_TreatDurationAsBilled(t *testing.T) { } mockServer := newMockServer(t, &mockServerOpts{ - Path: tempo.WorklogCreatePath, + Path: tempo.PathWorklogCreate, Method: http.MethodPost, StatusCode: http.StatusOK, Username: clientUsername, @@ -578,7 +578,7 @@ func TestTempoClient_UploadEntries_RoundToClosestMinute(t *testing.T) { } mockServer := newMockServer(t, &mockServerOpts{ - Path: tempo.WorklogCreatePath, + Path: tempo.PathWorklogCreate, Method: http.MethodPost, StatusCode: http.StatusOK, Username: clientUsername,