diff --git a/admin/api_client_impl_test.go b/admin/api_client_impl_test.go index 03757874..c3809fa6 100644 --- a/admin/api_client_impl_test.go +++ b/admin/api_client_impl_test.go @@ -290,7 +290,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: "rest/2/issue/attachment", type_: "", @@ -308,7 +308,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: " https://zhidao.baidu.com/special/view?id=49105a24626975510000&preview=1", body: bytes.NewReader([]byte("Hello World")), diff --git a/admin/internal/organization_directory_impl_test.go b/admin/internal/organization_directory_impl_test.go index 5ca0df64..588f3b20 100644 --- a/admin/internal/organization_directory_impl_test.go +++ b/admin/internal/organization_directory_impl_test.go @@ -33,7 +33,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Activity(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", accountID: "account-id-sample", }, @@ -62,7 +62,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Activity(t *testing.T) { { name: "when the organization id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "", }, wantErr: true, @@ -72,7 +72,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Activity(t *testing.T) { { name: "when the account id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", }, wantErr: true, @@ -82,7 +82,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Activity(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", accountID: "account-id-sample", }, @@ -159,7 +159,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Remove(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", accountID: "account-id-sample", }, @@ -188,7 +188,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Remove(t *testing.T) { { name: "when the organization id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "", }, wantErr: true, @@ -198,7 +198,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Remove(t *testing.T) { { name: "when the account id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", }, wantErr: true, @@ -208,7 +208,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Remove(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", accountID: "account-id-sample", }, @@ -284,7 +284,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Suspend(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", accountID: "account-id-sample", }, @@ -313,7 +313,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Suspend(t *testing.T) { { name: "when the organization id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "", }, wantErr: true, @@ -323,7 +323,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Suspend(t *testing.T) { { name: "when the account id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", }, wantErr: true, @@ -333,7 +333,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Suspend(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", accountID: "account-id-sample", }, @@ -410,7 +410,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Restore(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", accountID: "account-id-sample", }, @@ -439,7 +439,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Restore(t *testing.T) { { name: "when the organization id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "", }, wantErr: true, @@ -449,7 +449,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Restore(t *testing.T) { { name: "when the account id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", }, wantErr: true, @@ -459,7 +459,7 @@ func Test_internalOrganizationDirectoryServiceImpl_Restore(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", accountID: "account-id-sample", }, diff --git a/admin/internal/organization_impl_test.go b/admin/internal/organization_impl_test.go index 0cce3cc8..1b7b5866 100644 --- a/admin/internal/organization_impl_test.go +++ b/admin/internal/organization_impl_test.go @@ -34,7 +34,7 @@ func Test_internalOrganizationImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), cursor: "cursor-sample-uuid", }, on: func(fields *fields) { @@ -62,7 +62,7 @@ func Test_internalOrganizationImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), cursor: "cursor-sample-uuid", }, on: func(fields *fields) { @@ -137,7 +137,7 @@ func Test_internalOrganizationImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-sample-uuid", }, on: func(fields *fields) { @@ -165,7 +165,7 @@ func Test_internalOrganizationImpl_Get(t *testing.T) { { name: "when the organization id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "", }, wantErr: true, @@ -175,7 +175,7 @@ func Test_internalOrganizationImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-sample-uuid", }, on: func(fields *fields) { @@ -250,7 +250,7 @@ func Test_internalOrganizationImpl_Users(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-sample-uuid", cursor: "cursor-sample-uuid", }, @@ -279,7 +279,7 @@ func Test_internalOrganizationImpl_Users(t *testing.T) { { name: "when the organization id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "", }, wantErr: true, @@ -289,7 +289,7 @@ func Test_internalOrganizationImpl_Users(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-sample-uuid", cursor: "cursor-sample-uuid", }, @@ -365,7 +365,7 @@ func Test_internalOrganizationImpl_Domains(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-sample-uuid", cursor: "cursor-sample-uuid", }, @@ -394,7 +394,7 @@ func Test_internalOrganizationImpl_Domains(t *testing.T) { { name: "when the organization id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "", }, wantErr: true, @@ -404,7 +404,7 @@ func Test_internalOrganizationImpl_Domains(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-sample-uuid", cursor: "cursor-sample-uuid", }, @@ -480,7 +480,7 @@ func Test_internalOrganizationImpl_Domain(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-sample-uuid", domainID: "domain-sample-uuid", }, @@ -509,7 +509,7 @@ func Test_internalOrganizationImpl_Domain(t *testing.T) { { name: "when the organization id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "", }, wantErr: true, @@ -519,7 +519,7 @@ func Test_internalOrganizationImpl_Domain(t *testing.T) { { name: "when the domain id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-sample-uuid", }, wantErr: true, @@ -529,7 +529,7 @@ func Test_internalOrganizationImpl_Domain(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-sample-uuid", domainID: "domain-sample-uuid", }, @@ -617,7 +617,7 @@ func Test_internalOrganizationImpl_Events(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-sample-uuid", options: &model.OrganizationEventOptScheme{ Q: "qq", @@ -652,7 +652,7 @@ func Test_internalOrganizationImpl_Events(t *testing.T) { { name: "when the organization id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "", }, wantErr: true, @@ -662,7 +662,7 @@ func Test_internalOrganizationImpl_Events(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-sample-uuid", options: &model.OrganizationEventOptScheme{ Q: "qq", @@ -745,7 +745,7 @@ func Test_internalOrganizationImpl_Event(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-sample-uuid", eventID: "event-sample-uuid", }, @@ -774,7 +774,7 @@ func Test_internalOrganizationImpl_Event(t *testing.T) { { name: "when the organization id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "", }, wantErr: true, @@ -784,7 +784,7 @@ func Test_internalOrganizationImpl_Event(t *testing.T) { { name: "when the event id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-sample-uuid", }, wantErr: true, @@ -794,7 +794,7 @@ func Test_internalOrganizationImpl_Event(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-sample-uuid", eventID: "event-sample-uuid", }, @@ -870,7 +870,7 @@ func Test_internalOrganizationImpl_Actions(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-sample-uuid", }, on: func(fields *fields) { @@ -898,7 +898,7 @@ func Test_internalOrganizationImpl_Actions(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-sample-uuid", }, on: func(fields *fields) { diff --git a/admin/internal/organization_policy_impl_test.go b/admin/internal/organization_policy_impl_test.go index c74b2eac..b0efae2a 100644 --- a/admin/internal/organization_policy_impl_test.go +++ b/admin/internal/organization_policy_impl_test.go @@ -33,7 +33,7 @@ func Test_internalOrganizationPolicyImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", policyType: "policy-type-sample", cursor: "cursor-sample-uuid", @@ -63,7 +63,7 @@ func Test_internalOrganizationPolicyImpl_Gets(t *testing.T) { { name: "when the organization id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "", }, wantErr: true, @@ -73,7 +73,7 @@ func Test_internalOrganizationPolicyImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", policyType: "policy-type-sample", cursor: "cursor-sample-uuid", @@ -151,7 +151,7 @@ func Test_internalOrganizationPolicyImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", policyID: "policy-id-sample", }, @@ -180,7 +180,7 @@ func Test_internalOrganizationPolicyImpl_Get(t *testing.T) { { name: "when the organization id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "", }, wantErr: true, @@ -190,7 +190,7 @@ func Test_internalOrganizationPolicyImpl_Get(t *testing.T) { { name: "when the organization id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", }, wantErr: true, @@ -200,7 +200,7 @@ func Test_internalOrganizationPolicyImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", policyID: "policy-id-sample", }, @@ -287,7 +287,7 @@ func Test_internalOrganizationPolicyImpl_Create(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", payload: payloadMocked, }, @@ -316,7 +316,7 @@ func Test_internalOrganizationPolicyImpl_Create(t *testing.T) { { name: "when the organization id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "", }, wantErr: true, @@ -326,7 +326,7 @@ func Test_internalOrganizationPolicyImpl_Create(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", payload: payloadMocked, }, @@ -412,7 +412,7 @@ func Test_internalOrganizationPolicyImpl_Update(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", policyID: "policy-id-sample", payload: payloadMocked, @@ -442,7 +442,7 @@ func Test_internalOrganizationPolicyImpl_Update(t *testing.T) { { name: "when the organization id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "", }, wantErr: true, @@ -452,7 +452,7 @@ func Test_internalOrganizationPolicyImpl_Update(t *testing.T) { { name: "when the policy id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", }, wantErr: true, @@ -462,7 +462,7 @@ func Test_internalOrganizationPolicyImpl_Update(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", policyID: "policy-id-sample", payload: payloadMocked, @@ -539,7 +539,7 @@ func Test_internalOrganizationPolicyImpl_Delete(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", policyID: "policy-id-sample", }, @@ -568,7 +568,7 @@ func Test_internalOrganizationPolicyImpl_Delete(t *testing.T) { { name: "when the organization id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "", }, wantErr: true, @@ -578,7 +578,7 @@ func Test_internalOrganizationPolicyImpl_Delete(t *testing.T) { { name: "when the policy id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", }, wantErr: true, @@ -588,7 +588,7 @@ func Test_internalOrganizationPolicyImpl_Delete(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), organizationID: "organization-id-sample", policyID: "policy-id-sample", }, diff --git a/admin/internal/scim_group_impl_test.go b/admin/internal/scim_group_impl_test.go index 5c3c0c9b..78be3d57 100644 --- a/admin/internal/scim_group_impl_test.go +++ b/admin/internal/scim_group_impl_test.go @@ -34,7 +34,7 @@ func Test_internalSCIMGroupImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", filter: "filter-sample", startAt: 50, @@ -65,7 +65,7 @@ func Test_internalSCIMGroupImpl_Gets(t *testing.T) { { name: "when the directory id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "", }, wantErr: true, @@ -75,7 +75,7 @@ func Test_internalSCIMGroupImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", filter: "filter-sample", startAt: 50, @@ -154,7 +154,7 @@ func Test_internalSCIMGroupImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", groupID: "group-id-sample", }, @@ -183,7 +183,7 @@ func Test_internalSCIMGroupImpl_Get(t *testing.T) { { name: "when the directory id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "", }, wantErr: true, @@ -193,7 +193,7 @@ func Test_internalSCIMGroupImpl_Get(t *testing.T) { { name: "when the group id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "directory-id-sample", }, wantErr: true, @@ -203,7 +203,7 @@ func Test_internalSCIMGroupImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", groupID: "group-id-sample", }, @@ -280,7 +280,7 @@ func Test_internalSCIMGroupImpl_Delete(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", groupID: "group-id-sample", }, @@ -309,7 +309,7 @@ func Test_internalSCIMGroupImpl_Delete(t *testing.T) { { name: "when the directory id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "", }, wantErr: true, @@ -319,7 +319,7 @@ func Test_internalSCIMGroupImpl_Delete(t *testing.T) { { name: "when the group id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "directory-id-sample", }, wantErr: true, @@ -329,7 +329,7 @@ func Test_internalSCIMGroupImpl_Delete(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", groupID: "group-id-sample", }, @@ -407,7 +407,7 @@ func Test_internalSCIMGroupImpl_Create(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", groupName: "group-name-sample", }, @@ -436,7 +436,7 @@ func Test_internalSCIMGroupImpl_Create(t *testing.T) { { name: "when the directory id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "", }, wantErr: true, @@ -446,7 +446,7 @@ func Test_internalSCIMGroupImpl_Create(t *testing.T) { { name: "when the group name is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "directory-id-sample", }, wantErr: true, @@ -456,7 +456,7 @@ func Test_internalSCIMGroupImpl_Create(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", groupName: "group-name-sample", }, @@ -535,7 +535,7 @@ func Test_internalSCIMGroupImpl_Update(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", groupID: "group-id-sample", newGroupName: "group-name-sample", @@ -565,7 +565,7 @@ func Test_internalSCIMGroupImpl_Update(t *testing.T) { { name: "when the directory id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "", }, wantErr: true, @@ -575,7 +575,7 @@ func Test_internalSCIMGroupImpl_Update(t *testing.T) { { name: "when the group id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "directory-id-sample", }, wantErr: true, @@ -585,7 +585,7 @@ func Test_internalSCIMGroupImpl_Update(t *testing.T) { { name: "when the group name is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "directory-id-sample", groupID: "group-id-sample", }, @@ -596,7 +596,7 @@ func Test_internalSCIMGroupImpl_Update(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", groupID: "group-id-sample", newGroupName: "group-name-sample", @@ -691,7 +691,7 @@ func Test_internalSCIMGroupImpl_Path(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", groupID: "group-id-sample", payload: payloadMocked, @@ -721,7 +721,7 @@ func Test_internalSCIMGroupImpl_Path(t *testing.T) { { name: "when the directory id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "", }, wantErr: true, @@ -731,7 +731,7 @@ func Test_internalSCIMGroupImpl_Path(t *testing.T) { { name: "when the group id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "directory-id-sample", }, wantErr: true, @@ -741,7 +741,7 @@ func Test_internalSCIMGroupImpl_Path(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", groupID: "group-id-sample", payload: payloadMocked, diff --git a/admin/internal/scim_schema_impl_test.go b/admin/internal/scim_schema_impl_test.go index 28cf0358..8c156fa4 100644 --- a/admin/internal/scim_schema_impl_test.go +++ b/admin/internal/scim_schema_impl_test.go @@ -33,7 +33,7 @@ func Test_internalSCIMSchemaImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", }, on: func(fields *fields) { @@ -61,7 +61,7 @@ func Test_internalSCIMSchemaImpl_Gets(t *testing.T) { { name: "when the directory id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "", }, wantErr: true, @@ -71,7 +71,7 @@ func Test_internalSCIMSchemaImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", }, on: func(fields *fields) { @@ -146,7 +146,7 @@ func Test_internalSCIMSchemaImpl_Group(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", }, on: func(fields *fields) { @@ -174,7 +174,7 @@ func Test_internalSCIMSchemaImpl_Group(t *testing.T) { { name: "when the directory id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "", }, wantErr: true, @@ -184,7 +184,7 @@ func Test_internalSCIMSchemaImpl_Group(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", }, on: func(fields *fields) { @@ -259,7 +259,7 @@ func Test_internalSCIMSchemaImpl_User(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", }, on: func(fields *fields) { @@ -287,7 +287,7 @@ func Test_internalSCIMSchemaImpl_User(t *testing.T) { { name: "when the directory id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "", }, wantErr: true, @@ -297,7 +297,7 @@ func Test_internalSCIMSchemaImpl_User(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", }, on: func(fields *fields) { @@ -372,7 +372,7 @@ func Test_internalSCIMSchemaImpl_Enterprise(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", }, on: func(fields *fields) { @@ -400,7 +400,7 @@ func Test_internalSCIMSchemaImpl_Enterprise(t *testing.T) { { name: "when the directory id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "", }, wantErr: true, @@ -410,7 +410,7 @@ func Test_internalSCIMSchemaImpl_Enterprise(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", }, on: func(fields *fields) { @@ -485,7 +485,7 @@ func Test_internalSCIMSchemaImpl_Feature(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", }, on: func(fields *fields) { @@ -513,7 +513,7 @@ func Test_internalSCIMSchemaImpl_Feature(t *testing.T) { { name: "when the directory id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "", }, wantErr: true, @@ -523,7 +523,7 @@ func Test_internalSCIMSchemaImpl_Feature(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", }, on: func(fields *fields) { diff --git a/admin/internal/scim_user_impl_test.go b/admin/internal/scim_user_impl_test.go index be5afa84..d551d62b 100644 --- a/admin/internal/scim_user_impl_test.go +++ b/admin/internal/scim_user_impl_test.go @@ -35,7 +35,7 @@ func Test_internalSCIMUserImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", opts: &model.SCIMUserGetsOptionsScheme{ Attributes: []string{"attributes"}, @@ -70,7 +70,7 @@ func Test_internalSCIMUserImpl_Gets(t *testing.T) { { name: "when the directory id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "", }, wantErr: true, @@ -80,7 +80,7 @@ func Test_internalSCIMUserImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", opts: &model.SCIMUserGetsOptionsScheme{ Attributes: []string{"attributes"}, @@ -164,7 +164,7 @@ func Test_internalSCIMUserImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", userID: "user-id-uuid-sample", attributes: []string{"groups"}, @@ -195,7 +195,7 @@ func Test_internalSCIMUserImpl_Get(t *testing.T) { { name: "when the directory id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "", }, wantErr: true, @@ -205,7 +205,7 @@ func Test_internalSCIMUserImpl_Get(t *testing.T) { { name: "when the user id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", }, wantErr: true, @@ -215,7 +215,7 @@ func Test_internalSCIMUserImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", userID: "user-id-uuid-sample", attributes: []string{"groups"}, @@ -294,7 +294,7 @@ func Test_internalSCIMUserImpl_Deactivate(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", userID: "user-id-uuid-sample", }, @@ -323,7 +323,7 @@ func Test_internalSCIMUserImpl_Deactivate(t *testing.T) { { name: "when the directory id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "", }, wantErr: true, @@ -333,7 +333,7 @@ func Test_internalSCIMUserImpl_Deactivate(t *testing.T) { { name: "when the user id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", }, wantErr: true, @@ -343,7 +343,7 @@ func Test_internalSCIMUserImpl_Deactivate(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", userID: "user-id-uuid-sample", }, @@ -424,7 +424,7 @@ func Test_internalSCIMUserImpl_Path(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", userID: "user-id-uuid-sample", payload: payloadMocked, @@ -456,7 +456,7 @@ func Test_internalSCIMUserImpl_Path(t *testing.T) { { name: "when the directory id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "", }, wantErr: true, @@ -466,7 +466,7 @@ func Test_internalSCIMUserImpl_Path(t *testing.T) { { name: "when the user id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", }, wantErr: true, @@ -476,7 +476,7 @@ func Test_internalSCIMUserImpl_Path(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", userID: "user-id-uuid-sample", payload: payloadMocked, @@ -574,7 +574,7 @@ func Test_internalSCIMUserImpl_Update(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", userID: "user-id-uuid-sample", payload: payloadMocked, @@ -606,7 +606,7 @@ func Test_internalSCIMUserImpl_Update(t *testing.T) { { name: "when the directory id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "", }, wantErr: true, @@ -616,7 +616,7 @@ func Test_internalSCIMUserImpl_Update(t *testing.T) { { name: "when the user id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", }, wantErr: true, @@ -626,7 +626,7 @@ func Test_internalSCIMUserImpl_Update(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", userID: "user-id-uuid-sample", payload: payloadMocked, @@ -724,7 +724,7 @@ func Test_internalSCIMUserImpl_Create(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", payload: payloadMocked, attributes: []string{"groups"}, @@ -755,7 +755,7 @@ func Test_internalSCIMUserImpl_Create(t *testing.T) { { name: "when the directory id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "", }, wantErr: true, @@ -765,7 +765,7 @@ func Test_internalSCIMUserImpl_Create(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), directoryID: "direction-id-sample", payload: payloadMocked, attributes: []string{"groups"}, diff --git a/admin/internal/user_impl_test.go b/admin/internal/user_impl_test.go index 42e7c8c9..4d4484f7 100644 --- a/admin/internal/user_impl_test.go +++ b/admin/internal/user_impl_test.go @@ -34,7 +34,7 @@ func Test_internalUserImpl_Permissions(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "account-id-sample", privileges: []string{"privileges-sample"}, }, @@ -63,7 +63,7 @@ func Test_internalUserImpl_Permissions(t *testing.T) { { name: "when the account id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "", }, wantErr: true, @@ -73,7 +73,7 @@ func Test_internalUserImpl_Permissions(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "account-id-sample", privileges: []string{"privileges-sample"}, }, @@ -149,7 +149,7 @@ func Test_internalUserImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "account-id-sample", }, on: func(fields *fields) { @@ -177,7 +177,7 @@ func Test_internalUserImpl_Get(t *testing.T) { { name: "when the account id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "", }, wantErr: true, @@ -187,7 +187,7 @@ func Test_internalUserImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "account-id-sample", }, on: func(fields *fields) { @@ -262,7 +262,7 @@ func Test_internalUserImpl_Enable(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "account-id-sample", }, on: func(fields *fields) { @@ -290,7 +290,7 @@ func Test_internalUserImpl_Enable(t *testing.T) { { name: "when the account id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "", }, wantErr: true, @@ -300,7 +300,7 @@ func Test_internalUserImpl_Enable(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "account-id-sample", }, on: func(fields *fields) { @@ -376,7 +376,7 @@ func Test_internalUserImpl_Disable(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "account-id-sample", message: "Your account has been disabled :(", }, @@ -405,7 +405,7 @@ func Test_internalUserImpl_Disable(t *testing.T) { { name: "when the account id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "", }, wantErr: true, @@ -415,7 +415,7 @@ func Test_internalUserImpl_Disable(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "account-id-sample", message: "Your account has been disabled :(", }, @@ -493,7 +493,7 @@ func Test_internalUserImpl_Update(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "account-id-sample", payload: payloadMocked, }, @@ -522,7 +522,7 @@ func Test_internalUserImpl_Update(t *testing.T) { { name: "when the account id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "", }, wantErr: true, @@ -532,7 +532,7 @@ func Test_internalUserImpl_Update(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "account-id-sample", payload: payloadMocked, }, diff --git a/admin/internal/user_token_impl_test.go b/admin/internal/user_token_impl_test.go index 81b97d04..b28d8c31 100644 --- a/admin/internal/user_token_impl_test.go +++ b/admin/internal/user_token_impl_test.go @@ -34,7 +34,7 @@ func Test_internalUserTokenImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "account-id-sample", }, on: func(fields *fields) { @@ -61,7 +61,7 @@ func Test_internalUserTokenImpl_Gets(t *testing.T) { { name: "when the account id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "", }, wantErr: true, @@ -71,7 +71,7 @@ func Test_internalUserTokenImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "account-id-sample", }, on: func(fields *fields) { @@ -146,7 +146,7 @@ func Test_internalUserTokenImpl_Delete(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "account-id-sample", tokenID: "token-id-sample", }, @@ -174,7 +174,7 @@ func Test_internalUserTokenImpl_Delete(t *testing.T) { { name: "when the account id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "", }, wantErr: true, @@ -184,7 +184,7 @@ func Test_internalUserTokenImpl_Delete(t *testing.T) { { name: "when the token id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "account-id-sample", }, wantErr: true, @@ -194,7 +194,7 @@ func Test_internalUserTokenImpl_Delete(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountID: "account-id-sample", tokenID: "token-id-sample", }, diff --git a/assets/api_client_impl_test.go b/assets/api_client_impl_test.go index b832285e..a2799673 100644 --- a/assets/api_client_impl_test.go +++ b/assets/api_client_impl_test.go @@ -289,7 +289,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: "rest/2/issue/attachment", type_: "", @@ -307,7 +307,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: " https://zhidao.baidu.com/special/view?id=49105a24626975510000&preview=1", body: bytes.NewReader([]byte("Hello World")), diff --git a/assets/internal/aql_impl_test.go b/assets/internal/aql_impl_test.go index 5919a3d8..bfec3277 100644 --- a/assets/internal/aql_impl_test.go +++ b/assets/internal/aql_impl_test.go @@ -44,7 +44,7 @@ func Test_internalAQLImpl_Filter(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", payload: payloadMocked, }, @@ -72,7 +72,7 @@ func Test_internalAQLImpl_Filter(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", payload: payloadMocked, }, @@ -98,7 +98,7 @@ func Test_internalAQLImpl_Filter(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, diff --git a/assets/internal/icon_impl_test.go b/assets/internal/icon_impl_test.go index 4e2c7df6..dec817cf 100644 --- a/assets/internal/icon_impl_test.go +++ b/assets/internal/icon_impl_test.go @@ -34,7 +34,7 @@ func Test_internalIconImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", iconID: "1", }, @@ -62,7 +62,7 @@ func Test_internalIconImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", iconID: "1", }, @@ -88,7 +88,7 @@ func Test_internalIconImpl_Get(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -97,7 +97,7 @@ func Test_internalIconImpl_Get(t *testing.T) { { name: "when the icon id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, wantErr: true, @@ -156,7 +156,7 @@ func Test_internalIconImpl_Global(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, on: func(fields *fields) { @@ -183,7 +183,7 @@ func Test_internalIconImpl_Global(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, on: func(fields *fields) { @@ -208,7 +208,7 @@ func Test_internalIconImpl_Global(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, diff --git a/assets/internal/object_impl_test.go b/assets/internal/object_impl_test.go index d747bd08..7b0bbb3c 100644 --- a/assets/internal/object_impl_test.go +++ b/assets/internal/object_impl_test.go @@ -34,7 +34,7 @@ func Test_internalObjectImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectID: "1", }, @@ -62,7 +62,7 @@ func Test_internalObjectImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectID: "1", }, @@ -88,7 +88,7 @@ func Test_internalObjectImpl_Get(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -97,7 +97,7 @@ func Test_internalObjectImpl_Get(t *testing.T) { { name: "when the object id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, wantErr: true, @@ -156,7 +156,7 @@ func Test_internalObjectImpl_Delete(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectID: "1", }, @@ -184,7 +184,7 @@ func Test_internalObjectImpl_Delete(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectID: "1", }, @@ -210,7 +210,7 @@ func Test_internalObjectImpl_Delete(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -219,7 +219,7 @@ func Test_internalObjectImpl_Delete(t *testing.T) { { name: "when the object id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, wantErr: true, @@ -277,7 +277,7 @@ func Test_internalObjectImpl_Attributes(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectID: "1", }, @@ -305,7 +305,7 @@ func Test_internalObjectImpl_Attributes(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectID: "1", }, @@ -331,7 +331,7 @@ func Test_internalObjectImpl_Attributes(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -340,7 +340,7 @@ func Test_internalObjectImpl_Attributes(t *testing.T) { { name: "when the object id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, wantErr: true, @@ -400,7 +400,7 @@ func Test_internalObjectImpl_History(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectID: "1", ascOrder: true, @@ -429,7 +429,7 @@ func Test_internalObjectImpl_History(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectID: "1", ascOrder: true, @@ -456,7 +456,7 @@ func Test_internalObjectImpl_History(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -465,7 +465,7 @@ func Test_internalObjectImpl_History(t *testing.T) { { name: "when the object id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, wantErr: true, @@ -525,7 +525,7 @@ func Test_internalObjectImpl_References(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectID: "1", }, @@ -553,7 +553,7 @@ func Test_internalObjectImpl_References(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectID: "1", }, @@ -579,7 +579,7 @@ func Test_internalObjectImpl_References(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -588,7 +588,7 @@ func Test_internalObjectImpl_References(t *testing.T) { { name: "when the object id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, wantErr: true, @@ -647,7 +647,7 @@ func Test_internalObjectImpl_Relation(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectID: "1", }, @@ -675,7 +675,7 @@ func Test_internalObjectImpl_Relation(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectID: "1", }, @@ -701,7 +701,7 @@ func Test_internalObjectImpl_Relation(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -710,7 +710,7 @@ func Test_internalObjectImpl_Relation(t *testing.T) { { name: "when the object id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, wantErr: true, @@ -786,7 +786,7 @@ func Test_internalObjectImpl_Update(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectID: "object-uuid-sample", payload: payloadMocked, @@ -815,7 +815,7 @@ func Test_internalObjectImpl_Update(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectID: "object-uuid-sample", payload: payloadMocked, @@ -842,7 +842,7 @@ func Test_internalObjectImpl_Update(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -851,7 +851,7 @@ func Test_internalObjectImpl_Update(t *testing.T) { { name: "when the object id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, wantErr: true, @@ -935,7 +935,7 @@ func Test_internalObjectImpl_Create(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", payload: payloadMocked, }, @@ -963,7 +963,7 @@ func Test_internalObjectImpl_Create(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", payload: payloadMocked, }, @@ -989,7 +989,7 @@ func Test_internalObjectImpl_Create(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -1049,7 +1049,7 @@ func Test_internalObjectImpl_Filter(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", aql: "objectType = Office AND Name LIKE SYD", attributes: false, @@ -1080,7 +1080,7 @@ func Test_internalObjectImpl_Filter(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", aql: "objectType = Office AND Name LIKE SYD", attributes: false, @@ -1109,7 +1109,7 @@ func Test_internalObjectImpl_Filter(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -1118,7 +1118,7 @@ func Test_internalObjectImpl_Filter(t *testing.T) { { name: "when the aql query is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, wantErr: true, @@ -1191,7 +1191,7 @@ func Test_internalObjectImpl_Search(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", payload: payloadMocked, }, @@ -1219,7 +1219,7 @@ func Test_internalObjectImpl_Search(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", payload: payloadMocked, }, @@ -1245,7 +1245,7 @@ func Test_internalObjectImpl_Search(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, diff --git a/assets/internal/object_schema_impl_test.go b/assets/internal/object_schema_impl_test.go index d4339ed6..c953ee11 100644 --- a/assets/internal/object_schema_impl_test.go +++ b/assets/internal/object_schema_impl_test.go @@ -34,7 +34,7 @@ func Test_internalObjectSchemaImpl_List(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, on: func(fields *fields) { @@ -61,7 +61,7 @@ func Test_internalObjectSchemaImpl_List(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, on: func(fields *fields) { @@ -86,7 +86,7 @@ func Test_internalObjectSchemaImpl_List(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -144,7 +144,7 @@ func Test_internalObjectSchemaImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectSchemaID: "object-schema-id-sample", }, @@ -172,7 +172,7 @@ func Test_internalObjectSchemaImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectSchemaID: "object-schema-id-sample", }, @@ -198,7 +198,7 @@ func Test_internalObjectSchemaImpl_Get(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -207,7 +207,7 @@ func Test_internalObjectSchemaImpl_Get(t *testing.T) { { name: "when the object schema id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, wantErr: true, @@ -266,7 +266,7 @@ func Test_internalObjectSchemaImpl_Delete(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectSchemaID: "object-schema-id-sample", }, @@ -294,7 +294,7 @@ func Test_internalObjectSchemaImpl_Delete(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectSchemaID: "object-schema-id-sample", }, @@ -320,7 +320,7 @@ func Test_internalObjectSchemaImpl_Delete(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -329,7 +329,7 @@ func Test_internalObjectSchemaImpl_Delete(t *testing.T) { { name: "when the object schema id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, wantErr: true, @@ -395,7 +395,7 @@ func Test_internalObjectSchemaImpl_Attributes(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectSchemaID: "object-schema-id-sample", options: optionsMocked, @@ -424,7 +424,7 @@ func Test_internalObjectSchemaImpl_Attributes(t *testing.T) { { name: "when the options are not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectSchemaID: "object-schema-id-sample", }, @@ -452,7 +452,7 @@ func Test_internalObjectSchemaImpl_Attributes(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectSchemaID: "object-schema-id-sample", options: optionsMocked, @@ -479,7 +479,7 @@ func Test_internalObjectSchemaImpl_Attributes(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -488,7 +488,7 @@ func Test_internalObjectSchemaImpl_Attributes(t *testing.T) { { name: "when the object schema id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, wantErr: true, @@ -552,7 +552,7 @@ func Test_internalObjectSchemaImpl_ObjectTypes(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectSchemaID: "object-schema-id-sample", excludeAbstract: true, @@ -581,7 +581,7 @@ func Test_internalObjectSchemaImpl_ObjectTypes(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectSchemaID: "object-schema-id-sample", excludeAbstract: true, @@ -608,7 +608,7 @@ func Test_internalObjectSchemaImpl_ObjectTypes(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -617,7 +617,7 @@ func Test_internalObjectSchemaImpl_ObjectTypes(t *testing.T) { { name: "when the object schema id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, wantErr: true, @@ -687,7 +687,7 @@ func Test_internalObjectSchemaImpl_Update(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectSchemaID: "object-schema-id-sample", payload: payloadMocked, @@ -716,7 +716,7 @@ func Test_internalObjectSchemaImpl_Update(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectSchemaID: "object-schema-id-sample", payload: payloadMocked, @@ -743,7 +743,7 @@ func Test_internalObjectSchemaImpl_Update(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -752,7 +752,7 @@ func Test_internalObjectSchemaImpl_Update(t *testing.T) { { name: "when the object schema id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, wantErr: true, @@ -823,7 +823,7 @@ func Test_internalObjectSchemaImpl_Create(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", payload: payloadMocked, }, @@ -851,7 +851,7 @@ func Test_internalObjectSchemaImpl_Create(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", payload: payloadMocked, }, @@ -877,7 +877,7 @@ func Test_internalObjectSchemaImpl_Create(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, diff --git a/assets/internal/object_type_attribute_impl_test.go b/assets/internal/object_type_attribute_impl_test.go index 2e6caa10..1915b370 100644 --- a/assets/internal/object_type_attribute_impl_test.go +++ b/assets/internal/object_type_attribute_impl_test.go @@ -21,11 +21,11 @@ func Test_internalObjectTypeAttributeImpl_Create(t *testing.T) { minimumCardinality = 0 maximumCardinality = 0 payloadMocked := &model.ObjectTypeAttributePayloadScheme{ - Name: "Geolocation", - Label: false, - Type: &attributeType, - Description: "", - DefaultTypeId: &defaultTypeID, + Name: "Geolocation", + Label: false, + Type: &attributeType, + Description: "", + DefaultTypeId: &defaultTypeID, TypeValue: "", TypeValueMulti: nil, AdditionalValue: "", @@ -63,7 +63,7 @@ func Test_internalObjectTypeAttributeImpl_Create(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectTypeID: "object-type-uuid-sample", payload: payloadMocked, @@ -92,7 +92,7 @@ func Test_internalObjectTypeAttributeImpl_Create(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectTypeID: "object-type-uuid-sample", payload: payloadMocked, @@ -119,7 +119,7 @@ func Test_internalObjectTypeAttributeImpl_Create(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -128,7 +128,7 @@ func Test_internalObjectTypeAttributeImpl_Create(t *testing.T) { { name: "when the object type id id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, wantErr: true, @@ -181,11 +181,11 @@ func Test_internalObjectTypeAttributeImpl_Update(t *testing.T) { minimumCardinality = 0 maximumCardinality = 0 payloadMocked := &model.ObjectTypeAttributePayloadScheme{ - Name: "Geolocation", - Label: false, - Type: &attributeType, - Description: "", - DefaultTypeId: &defaultTypeID, + Name: "Geolocation", + Label: false, + Type: &attributeType, + Description: "", + DefaultTypeId: &defaultTypeID, TypeValue: "", TypeValueMulti: nil, AdditionalValue: "", @@ -223,7 +223,7 @@ func Test_internalObjectTypeAttributeImpl_Update(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectTypeID: "object-type-uuid-sample", attributeID: "attribute-id-sample", @@ -253,7 +253,7 @@ func Test_internalObjectTypeAttributeImpl_Update(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectTypeID: "object-type-uuid-sample", attributeID: "attribute-id-sample", @@ -281,7 +281,7 @@ func Test_internalObjectTypeAttributeImpl_Update(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -290,7 +290,7 @@ func Test_internalObjectTypeAttributeImpl_Update(t *testing.T) { { name: "when the object type id id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, wantErr: true, @@ -300,7 +300,7 @@ func Test_internalObjectTypeAttributeImpl_Update(t *testing.T) { { name: "when the attribute id id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectTypeID: "object-type-id-sample", }, @@ -366,7 +366,7 @@ func Test_internalObjectTypeAttributeImpl_Delete(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", attributeID: "attribute-id-sample", }, @@ -394,7 +394,7 @@ func Test_internalObjectTypeAttributeImpl_Delete(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", attributeID: "attribute-id-sample", }, @@ -420,7 +420,7 @@ func Test_internalObjectTypeAttributeImpl_Delete(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -429,7 +429,7 @@ func Test_internalObjectTypeAttributeImpl_Delete(t *testing.T) { { name: "when the attribute id id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, wantErr: true, diff --git a/assets/internal/object_type_impl_test.go b/assets/internal/object_type_impl_test.go index aa627237..913710d9 100644 --- a/assets/internal/object_type_impl_test.go +++ b/assets/internal/object_type_impl_test.go @@ -34,7 +34,7 @@ func Test_internalObjectTypeImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectTypeID: "object-type-id-sample", }, @@ -62,7 +62,7 @@ func Test_internalObjectTypeImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectTypeID: "object-type-id-sample", }, @@ -88,7 +88,7 @@ func Test_internalObjectTypeImpl_Get(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -97,7 +97,7 @@ func Test_internalObjectTypeImpl_Get(t *testing.T) { { name: "when the object type id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-id-sample", }, wantErr: true, @@ -156,7 +156,7 @@ func Test_internalObjectTypeImpl_Delete(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectTypeID: "object-type-id-sample", }, @@ -184,7 +184,7 @@ func Test_internalObjectTypeImpl_Delete(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectTypeID: "object-type-id-sample", }, @@ -210,7 +210,7 @@ func Test_internalObjectTypeImpl_Delete(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -219,7 +219,7 @@ func Test_internalObjectTypeImpl_Delete(t *testing.T) { { name: "when the object type id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -288,7 +288,7 @@ func Test_internalObjectTypeImpl_Attributes(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectTypeID: "object-type-id-sample", options: optionsMocked, @@ -317,7 +317,7 @@ func Test_internalObjectTypeImpl_Attributes(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectTypeID: "object-type-id-sample", options: optionsMocked, @@ -344,7 +344,7 @@ func Test_internalObjectTypeImpl_Attributes(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -353,7 +353,7 @@ func Test_internalObjectTypeImpl_Attributes(t *testing.T) { { name: "when the object type id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-id-sample", }, wantErr: true, @@ -424,7 +424,7 @@ func Test_internalObjectTypeImpl_Update(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectTypeID: "object-type-id-sample", payload: payloadMocked, @@ -453,7 +453,7 @@ func Test_internalObjectTypeImpl_Update(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectTypeID: "object-type-id-sample", payload: payloadMocked, @@ -480,7 +480,7 @@ func Test_internalObjectTypeImpl_Update(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -489,7 +489,7 @@ func Test_internalObjectTypeImpl_Update(t *testing.T) { { name: "when the object type id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, wantErr: true, @@ -564,7 +564,7 @@ func Test_internalObjectTypeImpl_Create(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", payload: payloadMocked, }, @@ -592,7 +592,7 @@ func Test_internalObjectTypeImpl_Create(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", payload: payloadMocked, }, @@ -618,7 +618,7 @@ func Test_internalObjectTypeImpl_Create(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -686,7 +686,7 @@ func Test_internalObjectTypeImpl_Position(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectTypeID: "object-type-id-sample", payload: payloadMocked, @@ -715,7 +715,7 @@ func Test_internalObjectTypeImpl_Position(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", objectTypeID: "object-type-id-sample", payload: payloadMocked, @@ -742,7 +742,7 @@ func Test_internalObjectTypeImpl_Position(t *testing.T) { { name: "when the workspace id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkspaceIDError, @@ -751,7 +751,7 @@ func Test_internalObjectTypeImpl_Position(t *testing.T) { { name: "when the object type id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspaceID: "workspace-uuid-sample", }, wantErr: true, diff --git a/bitbucket/api_client_impl_test.go b/bitbucket/api_client_impl_test.go index 4dcf696f..f7ff97d7 100644 --- a/bitbucket/api_client_impl_test.go +++ b/bitbucket/api_client_impl_test.go @@ -291,7 +291,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: "rest/2/issue/attachment", type_: "", @@ -309,7 +309,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: " https://zhidao.baidu.com/special/view?id=49105a24626975510000&preview=1", body: bytes.NewReader([]byte("Hello World")), @@ -326,7 +326,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: "rest/2/issue/attachment", type_: "type_sample", diff --git a/bitbucket/internal/workspace_impl_test.go b/bitbucket/internal/workspace_impl_test.go index 5125cb2c..3167b831 100644 --- a/bitbucket/internal/workspace_impl_test.go +++ b/bitbucket/internal/workspace_impl_test.go @@ -33,7 +33,7 @@ func Test_internalWorkspaceServiceImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", }, on: func(fields *fields) { @@ -59,7 +59,7 @@ func Test_internalWorkspaceServiceImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", }, on: func(fields *fields) { @@ -83,7 +83,7 @@ func Test_internalWorkspaceServiceImpl_Get(t *testing.T) { { name: "when the workspace is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "", }, wantErr: true, @@ -142,7 +142,7 @@ func Test_internalWorkspaceServiceImpl_Members(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", }, on: func(fields *fields) { @@ -168,7 +168,7 @@ func Test_internalWorkspaceServiceImpl_Members(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", }, on: func(fields *fields) { @@ -192,7 +192,7 @@ func Test_internalWorkspaceServiceImpl_Members(t *testing.T) { { name: "when the workspace is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "", }, wantErr: true, @@ -251,7 +251,7 @@ func Test_internalWorkspaceServiceImpl_Projects(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", }, on: func(fields *fields) { @@ -277,7 +277,7 @@ func Test_internalWorkspaceServiceImpl_Projects(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", }, on: func(fields *fields) { @@ -301,7 +301,7 @@ func Test_internalWorkspaceServiceImpl_Projects(t *testing.T) { { name: "when the workspace is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "", }, wantErr: true, @@ -361,7 +361,7 @@ func Test_internalWorkspaceServiceImpl_Membership(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", memberId: "account-id-sample", }, @@ -388,7 +388,7 @@ func Test_internalWorkspaceServiceImpl_Membership(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", memberId: "account-id-sample", }, @@ -413,7 +413,7 @@ func Test_internalWorkspaceServiceImpl_Membership(t *testing.T) { { name: "when the workspace is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "", }, wantErr: true, @@ -423,7 +423,7 @@ func Test_internalWorkspaceServiceImpl_Membership(t *testing.T) { { name: "when the member id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", }, wantErr: true, diff --git a/bitbucket/internal/workspace_permissions_impl_test.go b/bitbucket/internal/workspace_permissions_impl_test.go index bb794ad1..3eed0dd3 100644 --- a/bitbucket/internal/workspace_permissions_impl_test.go +++ b/bitbucket/internal/workspace_permissions_impl_test.go @@ -34,7 +34,7 @@ func Test_internalWorkspacePermissionServiceImpl_Members(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", query: "permission=\"owner\"", }, @@ -61,7 +61,7 @@ func Test_internalWorkspacePermissionServiceImpl_Members(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", query: "permission=\"owner\"", }, @@ -86,7 +86,7 @@ func Test_internalWorkspacePermissionServiceImpl_Members(t *testing.T) { { name: "when the workspace is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "", }, wantErr: true, @@ -147,7 +147,7 @@ func Test_internalWorkspacePermissionServiceImpl_Repositories(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", query: "permission=\"owner\"", sort: "user.display_name", @@ -175,7 +175,7 @@ func Test_internalWorkspacePermissionServiceImpl_Repositories(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", query: "permission=\"owner\"", sort: "user.display_name", @@ -201,7 +201,7 @@ func Test_internalWorkspacePermissionServiceImpl_Repositories(t *testing.T) { { name: "when the workspace is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "", }, wantErr: true, @@ -264,7 +264,7 @@ func Test_internalWorkspacePermissionServiceImpl_Repository(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", query: "permission=\"owner\"", sort: "user.display_name", @@ -293,7 +293,7 @@ func Test_internalWorkspacePermissionServiceImpl_Repository(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", query: "permission=\"owner\"", sort: "user.display_name", @@ -320,7 +320,7 @@ func Test_internalWorkspacePermissionServiceImpl_Repository(t *testing.T) { { name: "when the workspace is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "", }, wantErr: true, @@ -330,7 +330,7 @@ func Test_internalWorkspacePermissionServiceImpl_Repository(t *testing.T) { { name: "when the repository is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", }, wantErr: true, diff --git a/bitbucket/internal/workspace_webhooks_impl_test.go b/bitbucket/internal/workspace_webhooks_impl_test.go index 8e2f1630..9776003d 100644 --- a/bitbucket/internal/workspace_webhooks_impl_test.go +++ b/bitbucket/internal/workspace_webhooks_impl_test.go @@ -33,7 +33,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", }, on: func(fields *fields) { @@ -59,7 +59,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", }, on: func(fields *fields) { @@ -83,7 +83,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Gets(t *testing.T) { { name: "when the workspace is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "", }, wantErr: true, @@ -143,7 +143,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", webhookId: "uuid-sample", }, @@ -170,7 +170,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", webhookId: "uuid-sample", }, @@ -195,7 +195,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Get(t *testing.T) { { name: "when the workspace is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "", }, wantErr: true, @@ -205,7 +205,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Get(t *testing.T) { { name: "when the webhook is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", }, wantErr: true, @@ -272,7 +272,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Create(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", payload: payloadMocked, }, @@ -299,7 +299,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Create(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", payload: payloadMocked, }, @@ -324,7 +324,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Create(t *testing.T) { { name: "when the workspace is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "", }, wantErr: true, @@ -392,7 +392,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Update(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", webhookId: "webhook-uuid", payload: payloadMocked, @@ -420,7 +420,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Update(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", webhookId: "webhook-uuid", payload: payloadMocked, @@ -446,7 +446,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Update(t *testing.T) { { name: "when the workspace is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "", }, wantErr: true, @@ -456,7 +456,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Update(t *testing.T) { { name: "when the webhook is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", }, wantErr: true, @@ -517,7 +517,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Delete(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", webhookId: "uuid-sample", }, @@ -544,7 +544,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Delete(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", webhookId: "uuid-sample", }, @@ -569,7 +569,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Delete(t *testing.T) { { name: "when the workspace is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "", }, wantErr: true, @@ -579,7 +579,7 @@ func Test_internalWorkspaceWebhookServiceImpl_Delete(t *testing.T) { { name: "when the webhook is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), workspace: "work-space-name-sample", }, wantErr: true, diff --git a/confluence/api_client_impl_test.go b/confluence/api_client_impl_test.go index 3739fdf3..ee1350cd 100644 --- a/confluence/api_client_impl_test.go +++ b/confluence/api_client_impl_test.go @@ -291,7 +291,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: "rest/2/issue/attachment", type_: "", @@ -309,7 +309,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: " https://zhidao.baidu.com/special/view?id=49105a24626975510000&preview=1", body: bytes.NewReader([]byte("Hello World")), @@ -326,7 +326,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: "rest/2/issue/attachment", type_: "type_sample", diff --git a/confluence/internal/analytics_impl_test.go b/confluence/internal/analytics_impl_test.go index bf6a3021..43c22e20 100644 --- a/confluence/internal/analytics_impl_test.go +++ b/confluence/internal/analytics_impl_test.go @@ -33,7 +33,7 @@ func Test_internalAnalyticsServiceImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentId: "2337372172371", fromDate: "2023-10-03", }, @@ -60,7 +60,7 @@ func Test_internalAnalyticsServiceImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentId: "2337372172371", fromDate: "2023-10-03", }, @@ -85,7 +85,7 @@ func Test_internalAnalyticsServiceImpl_Get(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -143,7 +143,7 @@ func Test_internalAnalyticsServiceImpl_Distinct(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentId: "2337372172371", fromDate: "2023-10-03", }, @@ -170,7 +170,7 @@ func Test_internalAnalyticsServiceImpl_Distinct(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentId: "2337372172371", fromDate: "2023-10-03", }, @@ -195,7 +195,7 @@ func Test_internalAnalyticsServiceImpl_Distinct(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, diff --git a/confluence/internal/attachment_content_impl_test.go b/confluence/internal/attachment_content_impl_test.go index 76eaad3e..04653218 100644 --- a/confluence/internal/attachment_content_impl_test.go +++ b/confluence/internal/attachment_content_impl_test.go @@ -39,7 +39,7 @@ func Test_internalContentAttachmentImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100100101", startAt: 50, maxResults: 50, @@ -73,7 +73,7 @@ func Test_internalContentAttachmentImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100100101", startAt: 50, maxResults: 50, @@ -104,7 +104,7 @@ func Test_internalContentAttachmentImpl_Gets(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -175,7 +175,7 @@ func Test_internalContentAttachmentImpl_CreateOrUpdate(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), attachmentID: "3837272", status: "current", fileName: "LICENSE", @@ -206,7 +206,7 @@ func Test_internalContentAttachmentImpl_CreateOrUpdate(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), attachmentID: "3837272", status: "current", fileName: "LICENSE", @@ -234,7 +234,7 @@ func Test_internalContentAttachmentImpl_CreateOrUpdate(t *testing.T) { { name: "when the attachment id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentAttachmentIDError, @@ -243,7 +243,7 @@ func Test_internalContentAttachmentImpl_CreateOrUpdate(t *testing.T) { { name: "when the file name is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), attachmentID: "3837272", }, wantErr: true, @@ -253,7 +253,7 @@ func Test_internalContentAttachmentImpl_CreateOrUpdate(t *testing.T) { { name: "when the file reader is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), attachmentID: "3837272", fileName: "LICENSE", }, @@ -326,7 +326,7 @@ func Test_internalContentAttachmentImpl_Create(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), attachmentID: "3837272", status: "current", fileName: "LICENSE", @@ -357,7 +357,7 @@ func Test_internalContentAttachmentImpl_Create(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), attachmentID: "3837272", status: "current", fileName: "LICENSE", @@ -385,7 +385,7 @@ func Test_internalContentAttachmentImpl_Create(t *testing.T) { { name: "when the attachment id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentAttachmentIDError, @@ -394,7 +394,7 @@ func Test_internalContentAttachmentImpl_Create(t *testing.T) { { name: "when the file name is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), attachmentID: "3837272", }, wantErr: true, @@ -404,7 +404,7 @@ func Test_internalContentAttachmentImpl_Create(t *testing.T) { { name: "when the file reader is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), attachmentID: "3837272", fileName: "LICENSE", }, diff --git a/confluence/internal/attachment_impl_test.go b/confluence/internal/attachment_impl_test.go index 42288262..7a344454 100644 --- a/confluence/internal/attachment_impl_test.go +++ b/confluence/internal/attachment_impl_test.go @@ -35,7 +35,7 @@ func Test_internalAttachmentImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), attachmentID: "100001", versionID: 25, serializeIDs: true, @@ -64,7 +64,7 @@ func Test_internalAttachmentImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), attachmentID: "100001", versionID: 25, serializeIDs: true, @@ -90,7 +90,7 @@ func Test_internalAttachmentImpl_Get(t *testing.T) { { name: "when the attachment id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentAttachmentIDError, @@ -154,7 +154,7 @@ func Test_internalAttachmentImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), entityID: 10001, entityType: "labels", options: &model.AttachmentParamsScheme{ @@ -190,7 +190,7 @@ func Test_internalAttachmentImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), entityID: 10001, entityType: "labels", options: &model.AttachmentParamsScheme{ @@ -223,7 +223,7 @@ func Test_internalAttachmentImpl_Gets(t *testing.T) { { name: "when the entity id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoEntityIDError, @@ -232,7 +232,7 @@ func Test_internalAttachmentImpl_Gets(t *testing.T) { { name: "when the entity type provided is not valid", args: args{ - ctx: context.TODO(), + ctx: context.Background(), entityID: 1002, entityType: "questions", }, @@ -294,7 +294,7 @@ func Test_internalAttachmentImpl_Delete(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), attachmentID: "att10001", }, on: func(fields *fields) { @@ -321,7 +321,7 @@ func Test_internalAttachmentImpl_Delete(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), attachmentID: "att10001", }, on: func(fields *fields) { @@ -345,7 +345,7 @@ func Test_internalAttachmentImpl_Delete(t *testing.T) { { name: "when the attachment id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentAttachmentIDError, diff --git a/confluence/internal/attachment_version_impl_test.go b/confluence/internal/attachment_version_impl_test.go index c3cbcacf..fabddfd1 100644 --- a/confluence/internal/attachment_version_impl_test.go +++ b/confluence/internal/attachment_version_impl_test.go @@ -34,7 +34,7 @@ func Test_internalAttachmentVersionImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), attachmentID: "100001", sort: "-modified-date", cursor: "uuid-sample", @@ -64,7 +64,7 @@ func Test_internalAttachmentVersionImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), attachmentID: "100001", sort: "-modified-date", cursor: "uuid-sample", @@ -91,7 +91,7 @@ func Test_internalAttachmentVersionImpl_Gets(t *testing.T) { { name: "when the attachment id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentAttachmentIDError, @@ -152,7 +152,7 @@ func Test_internalAttachmentVersionImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), attachmentID: "100001", versionID: 10002, }, @@ -180,7 +180,7 @@ func Test_internalAttachmentVersionImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), attachmentID: "100001", versionID: 10002, }, @@ -205,7 +205,7 @@ func Test_internalAttachmentVersionImpl_Get(t *testing.T) { { name: "when the attachment id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentAttachmentIDError, diff --git a/confluence/internal/children_descendants_content_impl_test.go b/confluence/internal/children_descendants_content_impl_test.go index 84a90ddc..0ffee077 100644 --- a/confluence/internal/children_descendants_content_impl_test.go +++ b/confluence/internal/children_descendants_content_impl_test.go @@ -35,7 +35,7 @@ func Test_internalChildrenDescandantsImpl_Children(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100100101", expand: []string{"attachment", "comments"}, parentVersion: 12, @@ -64,7 +64,7 @@ func Test_internalChildrenDescandantsImpl_Children(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100100101", expand: []string{"attachment", "comments"}, parentVersion: 12, @@ -90,7 +90,7 @@ func Test_internalChildrenDescandantsImpl_Children(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -150,7 +150,7 @@ func Test_internalChildrenDescandantsImpl_Move(t *testing.T) { { name: "append when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), pageID: "101010101", position: "append", targetID: "202020202", @@ -178,7 +178,7 @@ func Test_internalChildrenDescandantsImpl_Move(t *testing.T) { { name: "position before when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), pageID: "101010101", position: "before", targetID: "202020202", @@ -206,7 +206,7 @@ func Test_internalChildrenDescandantsImpl_Move(t *testing.T) { { name: "position after when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), pageID: "101010101", position: "after", targetID: "202020202", @@ -234,7 +234,7 @@ func Test_internalChildrenDescandantsImpl_Move(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), pageID: "100100101", position: "append", targetID: "200200202", @@ -259,7 +259,7 @@ func Test_internalChildrenDescandantsImpl_Move(t *testing.T) { { name: "when the page id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), position: "append", targetID: "100100101", }, @@ -270,7 +270,7 @@ func Test_internalChildrenDescandantsImpl_Move(t *testing.T) { { name: "when the target id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), pageID: "100100101", position: "append", }, @@ -281,7 +281,7 @@ func Test_internalChildrenDescandantsImpl_Move(t *testing.T) { { name: "when the position is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), pageID: "100100101", targetID: "200200202", }, @@ -292,7 +292,7 @@ func Test_internalChildrenDescandantsImpl_Move(t *testing.T) { { name: "when the position is incorrect", args: args{ - ctx: context.TODO(), + ctx: context.Background(), pageID: "100100101", position: "gopher", targetID: "200200202", @@ -357,7 +357,7 @@ func Test_internalChildrenDescandantsImpl_ChildrenByType(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100100101", contentType: "blogpost", expand: []string{"attachment", "comments"}, @@ -389,7 +389,7 @@ func Test_internalChildrenDescandantsImpl_ChildrenByType(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100100101", contentType: "blogpost", expand: []string{"attachment", "comments"}, @@ -418,7 +418,7 @@ func Test_internalChildrenDescandantsImpl_ChildrenByType(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -427,7 +427,7 @@ func Test_internalChildrenDescandantsImpl_ChildrenByType(t *testing.T) { { name: "when the content type is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11929292", }, wantErr: true, @@ -490,7 +490,7 @@ func Test_internalChildrenDescandantsImpl_Descendants(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100100101", expand: []string{"attachment", "comments"}, }, @@ -518,7 +518,7 @@ func Test_internalChildrenDescandantsImpl_Descendants(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100100101", expand: []string{"attachment", "comments"}, }, @@ -543,7 +543,7 @@ func Test_internalChildrenDescandantsImpl_Descendants(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -603,7 +603,7 @@ func Test_internalChildrenDescandantsImpl_DescendantsByType(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100100101", contentType: "blogpost", expand: []string{"attachment", "comments"}, @@ -635,7 +635,7 @@ func Test_internalChildrenDescandantsImpl_DescendantsByType(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100100101", contentType: "blogpost", expand: []string{"attachment", "comments"}, @@ -664,7 +664,7 @@ func Test_internalChildrenDescandantsImpl_DescendantsByType(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -673,7 +673,7 @@ func Test_internalChildrenDescandantsImpl_DescendantsByType(t *testing.T) { { name: "when the content type is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11929292", }, wantErr: true, @@ -750,7 +750,7 @@ func Test_internalChildrenDescandantsImpl_CopyHierarchy(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100100101", options: payloadMocked, }, @@ -778,7 +778,7 @@ func Test_internalChildrenDescandantsImpl_CopyHierarchy(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100100101", options: payloadMocked, }, @@ -803,7 +803,7 @@ func Test_internalChildrenDescandantsImpl_CopyHierarchy(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -879,7 +879,7 @@ func Test_internalChildrenDescandantsImpl_CopyPage(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100100101", options: payloadMocked, expand: []string{"childTypes.all"}, @@ -908,7 +908,7 @@ func Test_internalChildrenDescandantsImpl_CopyPage(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100100101", options: payloadMocked, expand: []string{"childTypes.all"}, @@ -934,7 +934,7 @@ func Test_internalChildrenDescandantsImpl_CopyPage(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, diff --git a/confluence/internal/comment_content_impl_test.go b/confluence/internal/comment_content_impl_test.go index 9d132de8..f53a3a74 100644 --- a/confluence/internal/comment_content_impl_test.go +++ b/confluence/internal/comment_content_impl_test.go @@ -35,7 +35,7 @@ func Test_internalCommentImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100100101", expand: []string{"attachment", "comments"}, location: []string{"form"}, @@ -66,7 +66,7 @@ func Test_internalCommentImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100100101", expand: []string{"attachment", "comments"}, location: []string{"form"}, @@ -94,7 +94,7 @@ func Test_internalCommentImpl_Gets(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, diff --git a/confluence/internal/content_impl_test.go b/confluence/internal/content_impl_test.go index 4c441d35..bd099200 100644 --- a/confluence/internal/content_impl_test.go +++ b/confluence/internal/content_impl_test.go @@ -35,7 +35,7 @@ func Test_internalContentImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.GetContentOptionsScheme{ ContextType: "page", SpaceKey: "DUMMY", @@ -73,7 +73,7 @@ func Test_internalContentImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.GetContentOptionsScheme{ ContextType: "page", SpaceKey: "DUMMY", @@ -162,7 +162,7 @@ func Test_internalContentImpl_Search(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), cql: "space = DUMMY", cqlContext: "spaceKey", expand: []string{"restrictions.update.restrictions.user"}, @@ -192,7 +192,7 @@ func Test_internalContentImpl_Search(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), cql: "space = DUMMY", cqlContext: "spaceKey", expand: []string{"restrictions.update.restrictions.user"}, @@ -219,7 +219,7 @@ func Test_internalContentImpl_Search(t *testing.T) { { name: "when the cql is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoCQLError, @@ -281,7 +281,7 @@ func Test_internalContentImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11727271", expand: []string{"restrictions.update.restrictions.user"}, version: 23, @@ -309,7 +309,7 @@ func Test_internalContentImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11727271", expand: []string{"restrictions.update.restrictions.user"}, version: 23, @@ -334,7 +334,7 @@ func Test_internalContentImpl_Get(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -395,7 +395,7 @@ func Test_internalContentImpl_History(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11727271", expand: []string{"restrictions.update.restrictions.user"}, }, @@ -422,7 +422,7 @@ func Test_internalContentImpl_History(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11727271", expand: []string{"restrictions.update.restrictions.user"}, }, @@ -446,7 +446,7 @@ func Test_internalContentImpl_History(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -506,7 +506,7 @@ func Test_internalContentImpl_Delete(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11727271", status: "trashed", }, @@ -533,7 +533,7 @@ func Test_internalContentImpl_Delete(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11727271", status: "trashed", }, @@ -557,7 +557,7 @@ func Test_internalContentImpl_Delete(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -627,7 +627,7 @@ func Test_internalContentImpl_Create(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -653,7 +653,7 @@ func Test_internalContentImpl_Create(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -739,7 +739,7 @@ func Test_internalContentImpl_Update(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", payload: payloadMocked, }, @@ -766,7 +766,7 @@ func Test_internalContentImpl_Update(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", payload: payloadMocked, }, @@ -790,7 +790,7 @@ func Test_internalContentImpl_Update(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -857,7 +857,7 @@ func Test_internalContentImpl_Archive(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -883,7 +883,7 @@ func Test_internalContentImpl_Archive(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { diff --git a/confluence/internal/custom_content_impl_test.go b/confluence/internal/custom_content_impl_test.go index 2211a534..36272efa 100644 --- a/confluence/internal/custom_content_impl_test.go +++ b/confluence/internal/custom_content_impl_test.go @@ -36,7 +36,7 @@ func Test_internalCustomContentServiceImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), type_: "custom_content_type_id", options: &model.CustomContentOptionsScheme{ IDs: []int{101, 102}, @@ -71,7 +71,7 @@ func Test_internalCustomContentServiceImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), type_: "custom_content_type_id", options: &model.CustomContentOptionsScheme{ IDs: []int{101, 102}, @@ -102,7 +102,7 @@ func Test_internalCustomContentServiceImpl_Gets(t *testing.T) { { name: "when the type is not provided are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoCustomContentTypeError, @@ -179,7 +179,7 @@ func Test_internalCustomContentServiceImpl_Create(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -206,7 +206,7 @@ func Test_internalCustomContentServiceImpl_Create(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -299,7 +299,7 @@ func Test_internalCustomContentServiceImpl_Update(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), customContentID: 10001, payload: payloadMocked, }, @@ -327,7 +327,7 @@ func Test_internalCustomContentServiceImpl_Update(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), customContentID: 10001, payload: payloadMocked, }, @@ -351,7 +351,7 @@ func Test_internalCustomContentServiceImpl_Update(t *testing.T) { { name: "when the custom content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoCustomContentIDError, @@ -414,7 +414,7 @@ func Test_internalCustomContentServiceImpl_Delete(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), customContentID: 10001, }, on: func(fields *fields) { @@ -441,7 +441,7 @@ func Test_internalCustomContentServiceImpl_Delete(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), customContentID: 10001, }, on: func(fields *fields) { @@ -464,7 +464,7 @@ func Test_internalCustomContentServiceImpl_Delete(t *testing.T) { { name: "when the custom content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoCustomContentIDError, @@ -526,7 +526,7 @@ func Test_internalCustomContentServiceImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), customContentID: 10001, format: "anonymous_export_view", versionID: 2, @@ -555,7 +555,7 @@ func Test_internalCustomContentServiceImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), customContentID: 10001, format: "anonymous_export_view", versionID: 2, @@ -580,7 +580,7 @@ func Test_internalCustomContentServiceImpl_Get(t *testing.T) { { name: "when the custom content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoCustomContentIDError, diff --git a/confluence/internal/label_content_impl_test.go b/confluence/internal/label_content_impl_test.go index bab7d101..c1c9c9d6 100644 --- a/confluence/internal/label_content_impl_test.go +++ b/confluence/internal/label_content_impl_test.go @@ -35,7 +35,7 @@ func Test_internalContentLabelImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11727271", prefix: "new-", startAt: 25, @@ -64,7 +64,7 @@ func Test_internalContentLabelImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11727271", prefix: "new-", startAt: 25, @@ -90,7 +90,7 @@ func Test_internalContentLabelImpl_Gets(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -150,7 +150,7 @@ func Test_internalContentLabelImpl_Remove(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11727271", labelName: "test", }, @@ -177,7 +177,7 @@ func Test_internalContentLabelImpl_Remove(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11727271", labelName: "test", }, @@ -201,7 +201,7 @@ func Test_internalContentLabelImpl_Remove(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -210,7 +210,7 @@ func Test_internalContentLabelImpl_Remove(t *testing.T) { { name: "when the label name is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "1111", }, wantErr: true, @@ -278,7 +278,7 @@ func Test_internalContentLabelImpl_Add(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11727271", payload: payloadMocked, want400Response: true, @@ -306,7 +306,7 @@ func Test_internalContentLabelImpl_Add(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11727271", payload: payloadMocked, want400Response: true, @@ -331,7 +331,7 @@ func Test_internalContentLabelImpl_Add(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, diff --git a/confluence/internal/label_impl_test.go b/confluence/internal/label_impl_test.go index c942a729..f0b08617 100644 --- a/confluence/internal/label_impl_test.go +++ b/confluence/internal/label_impl_test.go @@ -34,7 +34,7 @@ func Test_internalLabelImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), labelName: "blogs", labelType: "blogpost", start: 200, @@ -64,7 +64,7 @@ func Test_internalLabelImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), labelName: "blogs", labelType: "blogpost", start: 200, @@ -91,7 +91,7 @@ func Test_internalLabelImpl_Get(t *testing.T) { { name: "when the label name is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoLabelNameError, diff --git a/confluence/internal/page_impl_test.go b/confluence/internal/page_impl_test.go index 1f8874d3..bfc78de8 100644 --- a/confluence/internal/page_impl_test.go +++ b/confluence/internal/page_impl_test.go @@ -38,7 +38,7 @@ func Test_internalPageImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), pageID: 200001, format: "atlas_doc_format", draft: true, @@ -67,7 +67,7 @@ func Test_internalPageImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), pageID: 200001, format: "atlas_doc_format", draft: true, @@ -94,7 +94,7 @@ func Test_internalPageImpl_Get(t *testing.T) { { name: "when the page id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoPageIDError, @@ -155,7 +155,7 @@ func Test_internalPageImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.PageOptionsScheme{ PageIDs: []int{112, 1223}, SpaceIDs: []int{3040, 3040}, @@ -190,7 +190,7 @@ func Test_internalPageImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), cursor: "cursor-sample", options: &model.PageOptionsScheme{ PageIDs: []int{112, 1223}, @@ -273,7 +273,7 @@ func Test_internalPageImpl_Bulk(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), cursor: "cursor-sample", limit: 200, }, @@ -300,7 +300,7 @@ func Test_internalPageImpl_Bulk(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), cursor: "cursor-sample", limit: 200, }, @@ -377,7 +377,7 @@ func Test_internalPageImpl_GetsByLabel(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), labelID: 20001, sort: "test-label", cursor: "cursor-sample", @@ -406,7 +406,7 @@ func Test_internalPageImpl_GetsByLabel(t *testing.T) { { name: "when the label id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoLabelIDError, @@ -415,7 +415,7 @@ func Test_internalPageImpl_GetsByLabel(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), labelID: 20001, sort: "test-label", cursor: "cursor-sample", @@ -494,7 +494,7 @@ func Test_internalPageImpl_GetsBySpace(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceID: 20001, cursor: "cursor-sample", limit: 200, @@ -522,7 +522,7 @@ func Test_internalPageImpl_GetsBySpace(t *testing.T) { { name: "when the space id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoSpaceIDError, @@ -531,7 +531,7 @@ func Test_internalPageImpl_GetsBySpace(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceID: 20001, cursor: "cursor-sample", limit: 200, @@ -608,7 +608,7 @@ func Test_internalPageImpl_GetsByParent(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), parentID: 20001, cursor: "cursor-sample", limit: 200, @@ -636,7 +636,7 @@ func Test_internalPageImpl_GetsByParent(t *testing.T) { { name: "when the parent id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoPageIDError, @@ -645,7 +645,7 @@ func Test_internalPageImpl_GetsByParent(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), parentID: 20001, cursor: "cursor-sample", limit: 200, @@ -671,7 +671,7 @@ func Test_internalPageImpl_GetsByParent(t *testing.T) { { name: "when the call fails", args: args{ - ctx: context.TODO(), + ctx: context.Background(), parentID: 20001, cursor: "cursor-sample", limit: 200, @@ -752,7 +752,7 @@ func Test_internalPageImpl_Delete(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), pageID: 200001, }, on: func(fields *fields) { @@ -778,7 +778,7 @@ func Test_internalPageImpl_Delete(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), pageID: 200001, }, on: func(fields *fields) { @@ -802,7 +802,7 @@ func Test_internalPageImpl_Delete(t *testing.T) { { name: "when the page id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoPageIDError, @@ -893,7 +893,7 @@ func Test_internalPageImpl_Create(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: mockedPayload, }, on: func(fields *fields) { @@ -919,7 +919,7 @@ func Test_internalPageImpl_Create(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: mockedPayload, }, on: func(fields *fields) { @@ -1033,7 +1033,7 @@ func Test_internalPageImpl_Update(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), pageID: 215646235, payload: mockedPayload, }, @@ -1060,7 +1060,7 @@ func Test_internalPageImpl_Update(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), pageID: 215646235, payload: mockedPayload, }, @@ -1085,7 +1085,7 @@ func Test_internalPageImpl_Update(t *testing.T) { { name: "when the page id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoPageIDError, diff --git a/confluence/internal/permission_content_impl_test.go b/confluence/internal/permission_content_impl_test.go index f54f1ecb..d2096ed8 100644 --- a/confluence/internal/permission_content_impl_test.go +++ b/confluence/internal/permission_content_impl_test.go @@ -42,7 +42,7 @@ func Test_internalPermissionImpl_Check(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100100101", payload: payloadMocked, }, @@ -70,7 +70,7 @@ func Test_internalPermissionImpl_Check(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100100101", payload: payloadMocked, }, @@ -95,7 +95,7 @@ func Test_internalPermissionImpl_Check(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, diff --git a/confluence/internal/permission_space_impl_test.go b/confluence/internal/permission_space_impl_test.go index 5fd25bbc..a3c9ecf4 100644 --- a/confluence/internal/permission_space_impl_test.go +++ b/confluence/internal/permission_space_impl_test.go @@ -45,7 +45,7 @@ func Test_internalSpacePermissionImpl_Add(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceKey: "DUMMY", payload: payloadMocked, }, @@ -72,7 +72,7 @@ func Test_internalSpacePermissionImpl_Add(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceKey: "DUMMY", payload: payloadMocked, }, @@ -96,7 +96,7 @@ func Test_internalSpacePermissionImpl_Add(t *testing.T) { { name: "when the space key is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoSpaceKeyError, @@ -175,7 +175,7 @@ func Test_internalSpacePermissionImpl_Bulk(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceKey: "DUMMY", payload: payloadMocked, }, @@ -202,7 +202,7 @@ func Test_internalSpacePermissionImpl_Bulk(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceKey: "DUMMY", payload: payloadMocked, }, @@ -226,7 +226,7 @@ func Test_internalSpacePermissionImpl_Bulk(t *testing.T) { { name: "when the space key is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoSpaceKeyError, @@ -285,7 +285,7 @@ func Test_internalSpacePermissionImpl_Remove(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceKey: "DUMMY", permissionID: 10001, }, @@ -312,7 +312,7 @@ func Test_internalSpacePermissionImpl_Remove(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceKey: "DUMMY", permissionID: 10001, }, @@ -336,7 +336,7 @@ func Test_internalSpacePermissionImpl_Remove(t *testing.T) { { name: "when the space key is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoSpaceKeyError, diff --git a/confluence/internal/properties_content_impl_test.go b/confluence/internal/properties_content_impl_test.go index 37729b21..5c377dd7 100644 --- a/confluence/internal/properties_content_impl_test.go +++ b/confluence/internal/properties_content_impl_test.go @@ -35,7 +35,7 @@ func Test_internalPropertyImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11101", expand: []string{"content", "version"}, startAt: 100, @@ -65,7 +65,7 @@ func Test_internalPropertyImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11101", expand: []string{"content", "version"}, startAt: 100, @@ -92,7 +92,7 @@ func Test_internalPropertyImpl_Gets(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -152,7 +152,7 @@ func Test_internalPropertyImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11101", key: "space-key", }, @@ -180,7 +180,7 @@ func Test_internalPropertyImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11101", key: "space-key", }, @@ -205,7 +205,7 @@ func Test_internalPropertyImpl_Get(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -214,7 +214,7 @@ func Test_internalPropertyImpl_Get(t *testing.T) { { name: "when the property name is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "1111", }, wantErr: true, @@ -274,7 +274,7 @@ func Test_internalPropertyImpl_Delete(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11101", key: "space-key", }, @@ -302,7 +302,7 @@ func Test_internalPropertyImpl_Delete(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11101", key: "space-key", }, @@ -327,7 +327,7 @@ func Test_internalPropertyImpl_Delete(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -336,7 +336,7 @@ func Test_internalPropertyImpl_Delete(t *testing.T) { { name: "when the property name is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "1111", }, wantErr: true, @@ -401,7 +401,7 @@ func Test_internalPropertyImpl_Create(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11101", payload: payloadMocked, }, @@ -429,7 +429,7 @@ func Test_internalPropertyImpl_Create(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "11101", payload: payloadMocked, }, @@ -454,7 +454,7 @@ func Test_internalPropertyImpl_Create(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, diff --git a/confluence/internal/restriction_content_impl_test.go b/confluence/internal/restriction_content_impl_test.go index 90936a01..e86abdad 100644 --- a/confluence/internal/restriction_content_impl_test.go +++ b/confluence/internal/restriction_content_impl_test.go @@ -36,7 +36,7 @@ func Test_internalRestrictionImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", expand: []string{"restrictions.user"}, startAt: 50, @@ -66,7 +66,7 @@ func Test_internalRestrictionImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", expand: []string{"restrictions.user"}, startAt: 50, @@ -93,7 +93,7 @@ func Test_internalRestrictionImpl_Gets(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -157,7 +157,7 @@ func Test_internalRestrictionImpl_Add(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", payload: payloadMocked, expand: []string{"restrictions.user"}, @@ -186,7 +186,7 @@ func Test_internalRestrictionImpl_Add(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", payload: payloadMocked, expand: []string{"restrictions.user"}, @@ -212,7 +212,7 @@ func Test_internalRestrictionImpl_Add(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -273,7 +273,7 @@ func Test_internalRestrictionImpl_Delete(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", expand: []string{"restrictions.user"}, }, @@ -301,7 +301,7 @@ func Test_internalRestrictionImpl_Delete(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", expand: []string{"restrictions.user"}, }, @@ -326,7 +326,7 @@ func Test_internalRestrictionImpl_Delete(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -389,7 +389,7 @@ func Test_internalRestrictionImpl_Update(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", payload: payloadMocked, expand: []string{"restrictions.user"}, @@ -418,7 +418,7 @@ func Test_internalRestrictionImpl_Update(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", payload: payloadMocked, expand: []string{"restrictions.user"}, @@ -444,7 +444,7 @@ func Test_internalRestrictionImpl_Update(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, diff --git a/confluence/internal/restriction_operation_content_impl_test.go b/confluence/internal/restriction_operation_content_impl_test.go index cdede856..b3ed070b 100644 --- a/confluence/internal/restriction_operation_content_impl_test.go +++ b/confluence/internal/restriction_operation_content_impl_test.go @@ -34,7 +34,7 @@ func Test_internalRestrictionOperationImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", expand: []string{"restrictions.user"}, }, @@ -62,7 +62,7 @@ func Test_internalRestrictionOperationImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", expand: []string{"restrictions.user"}, }, @@ -87,7 +87,7 @@ func Test_internalRestrictionOperationImpl_Gets(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -149,7 +149,7 @@ func Test_internalRestrictionOperationImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", operationKey: "read", expand: []string{"restrictions.user"}, @@ -180,7 +180,7 @@ func Test_internalRestrictionOperationImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", operationKey: "read", expand: []string{"restrictions.user"}, @@ -208,7 +208,7 @@ func Test_internalRestrictionOperationImpl_Get(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -217,7 +217,7 @@ func Test_internalRestrictionOperationImpl_Get(t *testing.T) { { name: "when the property key is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "1111", }, wantErr: true, diff --git a/confluence/internal/restriction_operation_group_content_impl_test.go b/confluence/internal/restriction_operation_group_content_impl_test.go index b3af1a85..291e423c 100644 --- a/confluence/internal/restriction_operation_group_content_impl_test.go +++ b/confluence/internal/restriction_operation_group_content_impl_test.go @@ -33,7 +33,7 @@ func Test_internalRestrictionOperationGroupImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", operationKey: "read", groupNameOrID: "confluence-users", @@ -62,7 +62,7 @@ func Test_internalRestrictionOperationGroupImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", operationKey: "read", groupNameOrID: "confluence-users", @@ -88,7 +88,7 @@ func Test_internalRestrictionOperationGroupImpl_Get(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -97,7 +97,7 @@ func Test_internalRestrictionOperationGroupImpl_Get(t *testing.T) { { name: "when the property key is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "1111", }, wantErr: true, @@ -107,7 +107,7 @@ func Test_internalRestrictionOperationGroupImpl_Get(t *testing.T) { { name: "when the group name or id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "1111", operationKey: "read", }, @@ -168,7 +168,7 @@ func Test_internalRestrictionOperationGroupImpl_Add(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", operationKey: "read", groupNameOrID: "confluence-users", @@ -197,7 +197,7 @@ func Test_internalRestrictionOperationGroupImpl_Add(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", operationKey: "read", groupNameOrID: "confluence-users", @@ -223,7 +223,7 @@ func Test_internalRestrictionOperationGroupImpl_Add(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -232,7 +232,7 @@ func Test_internalRestrictionOperationGroupImpl_Add(t *testing.T) { { name: "when the property key is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "1111", }, wantErr: true, @@ -242,7 +242,7 @@ func Test_internalRestrictionOperationGroupImpl_Add(t *testing.T) { { name: "when the group name or id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "1111", operationKey: "read", }, @@ -303,7 +303,7 @@ func Test_internalRestrictionOperationGroupImpl_Remove(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", operationKey: "read", groupNameOrID: "confluence-users", @@ -332,7 +332,7 @@ func Test_internalRestrictionOperationGroupImpl_Remove(t *testing.T) { { name: "when the group provided is an uuid type", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", operationKey: "read", groupNameOrID: "5185574c-4008-49bf-803c-e71baecf37d3", @@ -361,7 +361,7 @@ func Test_internalRestrictionOperationGroupImpl_Remove(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", operationKey: "read", groupNameOrID: "confluence-users", @@ -387,7 +387,7 @@ func Test_internalRestrictionOperationGroupImpl_Remove(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -396,7 +396,7 @@ func Test_internalRestrictionOperationGroupImpl_Remove(t *testing.T) { { name: "when the property key is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "1111", }, wantErr: true, @@ -406,7 +406,7 @@ func Test_internalRestrictionOperationGroupImpl_Remove(t *testing.T) { { name: "when the group name or id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "1111", operationKey: "read", }, diff --git a/confluence/internal/restriction_operation_user_content_impl_test.go b/confluence/internal/restriction_operation_user_content_impl_test.go index df1cfd7d..4b6e148e 100644 --- a/confluence/internal/restriction_operation_user_content_impl_test.go +++ b/confluence/internal/restriction_operation_user_content_impl_test.go @@ -33,7 +33,7 @@ func Test_internalRestrictionOperationUserImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", operationKey: "read", accountID: "06db0c76-115b-498e-9cd6-921d6f6dde46", @@ -62,7 +62,7 @@ func Test_internalRestrictionOperationUserImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", operationKey: "read", accountID: "06db0c76-115b-498e-9cd6-921d6f6dde46", @@ -88,7 +88,7 @@ func Test_internalRestrictionOperationUserImpl_Get(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -97,7 +97,7 @@ func Test_internalRestrictionOperationUserImpl_Get(t *testing.T) { { name: "when the property key is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "1111", }, wantErr: true, @@ -107,7 +107,7 @@ func Test_internalRestrictionOperationUserImpl_Get(t *testing.T) { { name: "when the account id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "1111", operationKey: "read", }, @@ -168,7 +168,7 @@ func Test_internalRestrictionOperationUserImpl_Add(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", operationKey: "read", accountID: "06db0c76-115b-498e-9cd6-921d6f6dde46", @@ -197,7 +197,7 @@ func Test_internalRestrictionOperationUserImpl_Add(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", operationKey: "read", accountID: "06db0c76-115b-498e-9cd6-921d6f6dde46", @@ -223,7 +223,7 @@ func Test_internalRestrictionOperationUserImpl_Add(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -232,7 +232,7 @@ func Test_internalRestrictionOperationUserImpl_Add(t *testing.T) { { name: "when the property key is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "1111", }, wantErr: true, @@ -242,7 +242,7 @@ func Test_internalRestrictionOperationUserImpl_Add(t *testing.T) { { name: "when the account id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "1111", operationKey: "read", }, @@ -303,7 +303,7 @@ func Test_internalRestrictionOperationUserImpl_Remove(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", operationKey: "read", accountID: "06db0c76-115b-498e-9cd6-921d6f6dde46", @@ -332,7 +332,7 @@ func Test_internalRestrictionOperationUserImpl_Remove(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "100001", operationKey: "read", accountID: "06db0c76-115b-498e-9cd6-921d6f6dde46", @@ -358,7 +358,7 @@ func Test_internalRestrictionOperationUserImpl_Remove(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -367,7 +367,7 @@ func Test_internalRestrictionOperationUserImpl_Remove(t *testing.T) { { name: "when the property key is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "1111", }, wantErr: true, @@ -377,7 +377,7 @@ func Test_internalRestrictionOperationUserImpl_Remove(t *testing.T) { { name: "when the account id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "1111", operationKey: "read", }, diff --git a/confluence/internal/search_impl_test.go b/confluence/internal/search_impl_test.go index 813e0383..cc7ed651 100644 --- a/confluence/internal/search_impl_test.go +++ b/confluence/internal/search_impl_test.go @@ -34,7 +34,7 @@ func Test_internalSearchImpl_Content(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), cql: "type=page", options: &model.SearchContentOptions{ Context: "spaceKey", @@ -74,7 +74,7 @@ func Test_internalSearchImpl_Content(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), cql: "type=page", options: &model.SearchContentOptions{ Context: "spaceKey", @@ -111,7 +111,7 @@ func Test_internalSearchImpl_Content(t *testing.T) { { name: "when the cql is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoCQLError, @@ -173,7 +173,7 @@ func Test_internalSearchImpl_Users(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), cql: "type=page", start: 20, limit: 50, @@ -203,7 +203,7 @@ func Test_internalSearchImpl_Users(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), cql: "type=page", start: 20, limit: 50, @@ -230,7 +230,7 @@ func Test_internalSearchImpl_Users(t *testing.T) { { name: "when the cql is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoCQLError, diff --git a/confluence/internal/space_impl_test.go b/confluence/internal/space_impl_test.go index c3c80dd0..13998d76 100644 --- a/confluence/internal/space_impl_test.go +++ b/confluence/internal/space_impl_test.go @@ -34,7 +34,7 @@ func Test_internalSpaceImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.GetSpacesOptionScheme{ SpaceKeys: []string{"DUMMY", "TEST"}, SpaceIDs: []int{1111, 2222, 3333}, @@ -72,7 +72,7 @@ func Test_internalSpaceImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.GetSpacesOptionScheme{ SpaceKeys: []string{"DUMMY", "TEST"}, SpaceIDs: []int{1111, 2222, 3333}, @@ -159,7 +159,7 @@ func Test_internalSpaceImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceKey: "DUMMY", expand: []string{"childtypes.all", "operations"}, }, @@ -187,7 +187,7 @@ func Test_internalSpaceImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceKey: "DUMMY", expand: []string{"childtypes.all", "operations"}, }, @@ -212,7 +212,7 @@ func Test_internalSpaceImpl_Get(t *testing.T) { { name: "when the space key is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoSpaceKeyError, @@ -273,7 +273,7 @@ func Test_internalSpaceImpl_Content(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceKey: "DUMMY", depth: "all", expand: []string{"childtypes.all", "operations"}, @@ -304,7 +304,7 @@ func Test_internalSpaceImpl_Content(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceKey: "DUMMY", depth: "all", expand: []string{"childtypes.all", "operations"}, @@ -332,7 +332,7 @@ func Test_internalSpaceImpl_Content(t *testing.T) { { name: "when the space key is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoSpaceKeyError, @@ -394,7 +394,7 @@ func Test_internalSpaceImpl_ContentByType(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceKey: "DUMMY", depth: "all", contentType: "page", @@ -426,7 +426,7 @@ func Test_internalSpaceImpl_ContentByType(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceKey: "DUMMY", depth: "all", contentType: "page", @@ -455,7 +455,7 @@ func Test_internalSpaceImpl_ContentByType(t *testing.T) { { name: "when the space key is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoSpaceKeyError, @@ -516,7 +516,7 @@ func Test_internalSpaceImpl_Delete(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceKey: "DUMMY", }, on: func(fields *fields) { @@ -543,7 +543,7 @@ func Test_internalSpaceImpl_Delete(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceKey: "DUMMY", }, on: func(fields *fields) { @@ -567,7 +567,7 @@ func Test_internalSpaceImpl_Delete(t *testing.T) { { name: "when the space key is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoSpaceKeyError, @@ -635,7 +635,7 @@ func Test_internalSpaceImpl_Create(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, private: true, }, @@ -663,7 +663,7 @@ func Test_internalSpaceImpl_Create(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, private: true, }, @@ -688,7 +688,7 @@ func Test_internalSpaceImpl_Create(t *testing.T) { { name: "when the space name is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: &model.CreateSpaceScheme{}, }, wantErr: true, @@ -698,7 +698,7 @@ func Test_internalSpaceImpl_Create(t *testing.T) { { name: "when the space key is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: &model.CreateSpaceScheme{ Name: "DUMMY Space", }, @@ -767,7 +767,7 @@ func Test_internalSpaceImpl_Update(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceKey: "DUMMY", payload: payloadMocked, }, @@ -795,7 +795,7 @@ func Test_internalSpaceImpl_Update(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceKey: "DUMMY", payload: payloadMocked, }, @@ -820,7 +820,7 @@ func Test_internalSpaceImpl_Update(t *testing.T) { { name: "when the space key is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoSpaceKeyError, diff --git a/confluence/internal/space_v2_impl_test.go b/confluence/internal/space_v2_impl_test.go index c83c970b..260ce8a8 100644 --- a/confluence/internal/space_v2_impl_test.go +++ b/confluence/internal/space_v2_impl_test.go @@ -46,7 +46,7 @@ func Test_internalSpaceV2Impl_Bulk(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: optionsMocked, cursor: "cursor_sample_uuid", limit: 50, @@ -75,7 +75,7 @@ func Test_internalSpaceV2Impl_Bulk(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: optionsMocked, cursor: "cursor_sample_uuid", limit: 50, @@ -153,7 +153,7 @@ func Test_internalSpaceV2Impl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceID: 10001, descriptionFormat: "view", }, @@ -181,7 +181,7 @@ func Test_internalSpaceV2Impl_Get(t *testing.T) { { name: "when the space id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoSpaceIDError, @@ -190,7 +190,7 @@ func Test_internalSpaceV2Impl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceID: 10001, descriptionFormat: "view", }, @@ -267,7 +267,7 @@ func Test_internalSpaceV2Impl_Permissions(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceID: 10001, cursor: "cursor_sample_uuid", limit: 50, @@ -296,7 +296,7 @@ func Test_internalSpaceV2Impl_Permissions(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), spaceID: 10001, cursor: "cursor_sample_uuid", limit: 50, diff --git a/confluence/internal/task_impl_test.go b/confluence/internal/task_impl_test.go index 4105eaa1..5f5acd12 100644 --- a/confluence/internal/task_impl_test.go +++ b/confluence/internal/task_impl_test.go @@ -34,7 +34,7 @@ func Test_internalTaskImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), start: 20, limit: 50, }, @@ -62,7 +62,7 @@ func Test_internalTaskImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), start: 20, limit: 50, }, @@ -137,7 +137,7 @@ func Test_internalTaskImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), taskID: "2272737477", }, on: func(fields *fields) { @@ -164,7 +164,7 @@ func Test_internalTaskImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), taskID: "2272737477", }, on: func(fields *fields) { diff --git a/confluence/internal/version_content_test.go b/confluence/internal/version_content_test.go index 41ae5cb2..97cbdea6 100644 --- a/confluence/internal/version_content_test.go +++ b/confluence/internal/version_content_test.go @@ -35,7 +35,7 @@ func Test_internalVersionImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "3838282", expand: []string{"operations"}, start: 20, @@ -65,7 +65,7 @@ func Test_internalVersionImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "3838282", expand: []string{"operations"}, start: 20, @@ -92,7 +92,7 @@ func Test_internalVersionImpl_Gets(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -154,7 +154,7 @@ func Test_internalVersionImpl_Get(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "3838282", expand: []string{"operations"}, versionNumber: 29, @@ -183,7 +183,7 @@ func Test_internalVersionImpl_Get(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "3838282", expand: []string{"operations"}, versionNumber: 29, @@ -209,7 +209,7 @@ func Test_internalVersionImpl_Get(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -280,7 +280,7 @@ func Test_internalVersionImpl_Restore(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "3838282", payload: payloadMocked, expand: []string{"operations"}, @@ -309,7 +309,7 @@ func Test_internalVersionImpl_Restore(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "3838282", payload: payloadMocked, expand: []string{"operations"}, @@ -335,7 +335,7 @@ func Test_internalVersionImpl_Restore(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, @@ -396,7 +396,7 @@ func Test_internalVersionImpl_Delete(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "3838282", versionNumber: 29, }, @@ -424,7 +424,7 @@ func Test_internalVersionImpl_Delete(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), contentID: "3838282", versionNumber: 29, }, @@ -449,7 +449,7 @@ func Test_internalVersionImpl_Delete(t *testing.T) { { name: "when the content id is not provided", args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoContentIDError, diff --git a/confluence/v2/api_client_impl_test.go b/confluence/v2/api_client_impl_test.go index 3739fdf3..ee1350cd 100644 --- a/confluence/v2/api_client_impl_test.go +++ b/confluence/v2/api_client_impl_test.go @@ -291,7 +291,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: "rest/2/issue/attachment", type_: "", @@ -309,7 +309,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: " https://zhidao.baidu.com/special/view?id=49105a24626975510000&preview=1", body: bytes.NewReader([]byte("Hello World")), @@ -326,7 +326,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: "rest/2/issue/attachment", type_: "type_sample", diff --git a/jira/agile/api_client_impl_test.go b/jira/agile/api_client_impl_test.go index efad4601..65124f82 100644 --- a/jira/agile/api_client_impl_test.go +++ b/jira/agile/api_client_impl_test.go @@ -298,7 +298,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: "rest/2/issue/attachment", type_: "", @@ -316,7 +316,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: " https://zhidao.baidu.com/special/view?id=49105a24626975510000&preview=1", body: bytes.NewReader([]byte("Hello World")), diff --git a/jira/internal/attachment_impl_test.go b/jira/internal/attachment_impl_test.go index 28c58a19..9d885394 100644 --- a/jira/internal/attachment_impl_test.go +++ b/jira/internal/attachment_impl_test.go @@ -647,7 +647,7 @@ func Test_internalIssueAttachmentServiceImpl_Add(t *testing.T) { client.On("Call", &http.Request{}, - []*model.IssueAttachmentScheme(nil)). + mock.Anything). Return(&model.ResponseScheme{}, nil) fields.c = client @@ -677,7 +677,7 @@ func Test_internalIssueAttachmentServiceImpl_Add(t *testing.T) { client.On("Call", &http.Request{}, - []*model.IssueAttachmentScheme(nil)). + mock.Anything). Return(&model.ResponseScheme{}, nil) fields.c = client diff --git a/jira/internal/comment_impl_adf_test.go b/jira/internal/comment_impl_adf_test.go index 8523b5b9..f9ae60a2 100644 --- a/jira/internal/comment_impl_adf_test.go +++ b/jira/internal/comment_impl_adf_test.go @@ -39,7 +39,7 @@ func Test_internalAdfCommentImpl_Gets(t *testing.T) { name: "when the document format is adf (atlassian document format)", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", orderBy: "id", expand: []string{"renderedBody"}, @@ -74,7 +74,7 @@ func Test_internalAdfCommentImpl_Gets(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", orderBy: "id", expand: []string{"renderedBody"}, @@ -89,7 +89,7 @@ func Test_internalAdfCommentImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", orderBy: "id", expand: []string{"renderedBody"}, @@ -172,7 +172,7 @@ func Test_internalAdfCommentImpl_Get(t *testing.T) { name: "when the document format is adf (atlassian document format)", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", commentId: "10001", }, @@ -204,7 +204,7 @@ func Test_internalAdfCommentImpl_Get(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", }, wantErr: true, @@ -215,7 +215,7 @@ func Test_internalAdfCommentImpl_Get(t *testing.T) { name: "when the comment id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", }, wantErr: true, @@ -226,7 +226,7 @@ func Test_internalAdfCommentImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", commentId: "10001", }, @@ -305,7 +305,7 @@ func Test_internalAdfCommentImpl_Delete(t *testing.T) { name: "when the document format is adf (atlassian document format)", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", commentId: "10001", }, @@ -337,7 +337,7 @@ func Test_internalAdfCommentImpl_Delete(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", }, wantErr: true, @@ -348,7 +348,7 @@ func Test_internalAdfCommentImpl_Delete(t *testing.T) { name: "when the comment id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", }, wantErr: true, @@ -359,7 +359,7 @@ func Test_internalAdfCommentImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", commentId: "10001", }, @@ -478,7 +478,7 @@ func Test_internalAdfCommentImpl_Add(t *testing.T) { name: "when the document format is adf (atlassian document format)", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", payload: payloadMocked, expand: []string{"body"}, @@ -511,7 +511,7 @@ func Test_internalAdfCommentImpl_Add(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", payload: payloadMocked, expand: []string{"body"}, @@ -524,7 +524,7 @@ func Test_internalAdfCommentImpl_Add(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", payload: payloadMocked, expand: []string{"body"}, diff --git a/jira/internal/comment_impl_rich_text_test.go b/jira/internal/comment_impl_rich_text_test.go index 26345b42..8a8daae4 100644 --- a/jira/internal/comment_impl_rich_text_test.go +++ b/jira/internal/comment_impl_rich_text_test.go @@ -39,7 +39,7 @@ func Test_internalRichTextCommentImpl_Gets(t *testing.T) { name: "when the document format is rich-text", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", orderBy: "id", expand: []string{"renderedBody"}, @@ -74,7 +74,7 @@ func Test_internalRichTextCommentImpl_Gets(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", orderBy: "id", expand: []string{"renderedBody"}, @@ -89,7 +89,7 @@ func Test_internalRichTextCommentImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", orderBy: "id", expand: []string{"renderedBody"}, @@ -172,7 +172,7 @@ func Test_internalRichTextCommentImpl_Get(t *testing.T) { name: "when the document format is rich-text", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", commentId: "10001", }, @@ -204,7 +204,7 @@ func Test_internalRichTextCommentImpl_Get(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", }, wantErr: true, @@ -215,7 +215,7 @@ func Test_internalRichTextCommentImpl_Get(t *testing.T) { name: "when the comment id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", }, wantErr: true, @@ -226,7 +226,7 @@ func Test_internalRichTextCommentImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", commentId: "10001", }, @@ -305,7 +305,7 @@ func Test_internalRichTextCommentImpl_Delete(t *testing.T) { name: "when the document format is rich-text", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", commentId: "10001", }, @@ -337,7 +337,7 @@ func Test_internalRichTextCommentImpl_Delete(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", }, wantErr: true, @@ -348,7 +348,7 @@ func Test_internalRichTextCommentImpl_Delete(t *testing.T) { name: "when the comment id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", }, wantErr: true, @@ -359,7 +359,7 @@ func Test_internalRichTextCommentImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", commentId: "10001", }, @@ -447,7 +447,7 @@ func Test_internalRichTextCommentImpl_Add(t *testing.T) { name: "when the document format is rich-text", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", payload: payloadMocked, expand: []string{"body"}, @@ -480,7 +480,7 @@ func Test_internalRichTextCommentImpl_Add(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", payload: payloadMocked, expand: []string{"body"}, @@ -493,7 +493,7 @@ func Test_internalRichTextCommentImpl_Add(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", payload: payloadMocked, expand: []string{"body"}, diff --git a/jira/internal/field_configuration_impl_test.go b/jira/internal/field_configuration_impl_test.go index 3ce892a3..95009024 100644 --- a/jira/internal/field_configuration_impl_test.go +++ b/jira/internal/field_configuration_impl_test.go @@ -37,7 +37,7 @@ func Test_internalIssueFieldConfigServiceImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), ids: []int{10000, 100001}, isDefault: false, startAt: 50, @@ -71,7 +71,7 @@ func Test_internalIssueFieldConfigServiceImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), ids: []int{10000, 100001}, isDefault: false, startAt: 50, @@ -105,7 +105,7 @@ func Test_internalIssueFieldConfigServiceImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), ids: []int{10000, 100001}, isDefault: false, startAt: 50, @@ -194,7 +194,7 @@ func Test_internalIssueFieldConfigServiceImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), name: "DUMMY Field Configuration Scheme", description: "description sample", }, @@ -226,7 +226,7 @@ func Test_internalIssueFieldConfigServiceImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), name: "DUMMY Field Configuration Scheme", description: "description sample", }, @@ -258,7 +258,7 @@ func Test_internalIssueFieldConfigServiceImpl_Create(t *testing.T) { name: "when the description is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), name: "DUMMY Field Configuration Scheme", description: "", }, @@ -290,7 +290,7 @@ func Test_internalIssueFieldConfigServiceImpl_Create(t *testing.T) { name: "when the field configuration name is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), name: "", description: "description sample", }, @@ -302,7 +302,7 @@ func Test_internalIssueFieldConfigServiceImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), name: "DUMMY Field Configuration Scheme", description: "description sample", }, @@ -389,7 +389,7 @@ func Test_internalIssueFieldConfigServiceImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: 1001, name: "DUMMY Field Configuration Scheme", description: "description sample", @@ -422,7 +422,7 @@ func Test_internalIssueFieldConfigServiceImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: 1001, name: "DUMMY Field Configuration Scheme", description: "description sample", @@ -455,7 +455,7 @@ func Test_internalIssueFieldConfigServiceImpl_Update(t *testing.T) { name: "when the description is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: 1001, name: "DUMMY Field Configuration Scheme", description: "", @@ -488,7 +488,7 @@ func Test_internalIssueFieldConfigServiceImpl_Update(t *testing.T) { name: "when the field configuration name is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: 1001, name: "", description: "description sample", @@ -501,7 +501,7 @@ func Test_internalIssueFieldConfigServiceImpl_Update(t *testing.T) { name: "when the field configuration id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: 0, name: "field configuration id", description: "description sample", @@ -514,7 +514,7 @@ func Test_internalIssueFieldConfigServiceImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: 1001, name: "DUMMY Field Configuration Scheme", description: "description sample", @@ -594,7 +594,7 @@ func Test_internalIssueFieldConfigServiceImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: 1001, }, on: func(fields *fields) { @@ -625,7 +625,7 @@ func Test_internalIssueFieldConfigServiceImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: 1001, }, on: func(fields *fields) { @@ -656,7 +656,7 @@ func Test_internalIssueFieldConfigServiceImpl_Delete(t *testing.T) { name: "when the field configuration id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: 0, }, wantErr: true, @@ -667,7 +667,7 @@ func Test_internalIssueFieldConfigServiceImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: 1001, }, on: func(fields *fields) { diff --git a/jira/internal/field_configuration_item_impl_test.go b/jira/internal/field_configuration_item_impl_test.go index c2308f60..99b6fc8b 100644 --- a/jira/internal/field_configuration_item_impl_test.go +++ b/jira/internal/field_configuration_item_impl_test.go @@ -35,7 +35,7 @@ func Test_internalIssueFieldConfigItemServiceImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: 10001, startAt: 50, maxResults: 50, @@ -68,7 +68,7 @@ func Test_internalIssueFieldConfigItemServiceImpl_Gets(t *testing.T) { name: "when the field config is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), startAt: 50, maxResults: 50, }, @@ -80,7 +80,7 @@ func Test_internalIssueFieldConfigItemServiceImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: 10001, startAt: 50, maxResults: 50, @@ -113,7 +113,7 @@ func Test_internalIssueFieldConfigItemServiceImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: 10001, startAt: 50, maxResults: 50, @@ -216,7 +216,7 @@ func Test_internalIssueFieldConfigItemServiceImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: 10001, payload: payloadMocked, }, @@ -248,7 +248,7 @@ func Test_internalIssueFieldConfigItemServiceImpl_Update(t *testing.T) { name: "when the field config is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoFieldConfigurationIDError, @@ -258,7 +258,7 @@ func Test_internalIssueFieldConfigItemServiceImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: 10001, payload: payloadMocked, }, @@ -290,7 +290,7 @@ func Test_internalIssueFieldConfigItemServiceImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: 10001, payload: payloadMocked, }, diff --git a/jira/internal/field_configuration_scheme_test.go b/jira/internal/field_configuration_scheme_test.go index 400f3415..a5c19531 100644 --- a/jira/internal/field_configuration_scheme_test.go +++ b/jira/internal/field_configuration_scheme_test.go @@ -36,7 +36,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), ids: []int{10001}, startAt: 50, maxResults: 50, @@ -68,7 +68,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), ids: []int{10001}, startAt: 50, maxResults: 50, @@ -100,7 +100,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), ids: []int{10001}, startAt: 50, maxResults: 50, @@ -184,7 +184,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), name: "field scheme sample", description: "field scheme sample", }, @@ -215,7 +215,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), name: "field scheme sample", description: "field scheme sample", }, @@ -246,7 +246,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Create(t *testing.T) { name: "when the description is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), name: "field scheme sample", description: "", }, @@ -277,7 +277,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), name: "field scheme sample", description: "field scheme sample", }, @@ -357,7 +357,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Mapping(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldConfigIds: []int{10001}, startAt: 50, maxResults: 50, @@ -389,7 +389,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Mapping(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldConfigIds: []int{10001}, startAt: 50, maxResults: 50, @@ -421,7 +421,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Mapping(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldConfigIds: []int{10001}, startAt: 50, maxResults: 50, @@ -502,7 +502,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Project(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectIds: []int{10001}, startAt: 50, maxResults: 50, @@ -534,7 +534,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Project(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectIds: []int{10001}, startAt: 50, maxResults: 50, @@ -566,7 +566,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Project(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectIds: []int{10001}, startAt: 50, maxResults: 50, @@ -651,7 +651,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Assign(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -681,7 +681,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Assign(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -766,7 +766,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10001, name: "name sample", description: "description sample", @@ -798,7 +798,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Update(t *testing.T) { name: "when the description is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10001, name: "name sample", description: "", @@ -830,7 +830,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Update(t *testing.T) { name: "when the scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 0, name: "name sample", description: "description sample", @@ -843,7 +843,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Update(t *testing.T) { name: "when the scheme name is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10001, name: "", description: "description sample", @@ -856,7 +856,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10001, name: "name sample", description: "description sample", @@ -938,7 +938,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10001, }, on: func(fields *fields) { @@ -968,7 +968,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Delete(t *testing.T) { name: "when the scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 0, }, wantErr: true, @@ -979,7 +979,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10001, }, on: func(fields *fields) { @@ -1073,7 +1073,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Link(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10001, payload: payloadMocked, }, @@ -1104,7 +1104,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Link(t *testing.T) { name: "when the scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 0, payload: payloadMocked, }, @@ -1116,7 +1116,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Link(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10001, payload: payloadMocked, }, @@ -1147,7 +1147,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Link(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10001, payload: payloadMocked, }, @@ -1226,7 +1226,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Unlink(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10001, issueTypeIDs: []string{"1001", "1002"}, }, @@ -1257,7 +1257,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Unlink(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10001, issueTypeIDs: []string{"1001", "1002"}, }, @@ -1288,7 +1288,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Unlink(t *testing.T) { name: "when the scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 0, }, wantErr: true, @@ -1299,7 +1299,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Unlink(t *testing.T) { name: "when the issuetype id's are not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 1000, }, wantErr: true, @@ -1310,7 +1310,7 @@ func Test_internalIssueFieldConfigSchemeServiceImpl_Unlink(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10001, issueTypeIDs: []string{"1001", "1002"}, }, diff --git a/jira/internal/field_context_impl_test.go b/jira/internal/field_context_impl_test.go index bcda6c83..4841d41f 100644 --- a/jira/internal/field_context_impl_test.go +++ b/jira/internal/field_context_impl_test.go @@ -37,7 +37,7 @@ func Test_internalIssueFieldContextServiceImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", options: &model.FieldContextOptionsScheme{ IsAnyIssueType: true, @@ -74,7 +74,7 @@ func Test_internalIssueFieldContextServiceImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", options: &model.FieldContextOptionsScheme{ IsAnyIssueType: true, @@ -111,7 +111,7 @@ func Test_internalIssueFieldContextServiceImpl_Gets(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "", options: &model.FieldContextOptionsScheme{ IsAnyIssueType: true, @@ -129,7 +129,7 @@ func Test_internalIssueFieldContextServiceImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", options: &model.FieldContextOptionsScheme{ IsAnyIssueType: true, @@ -222,7 +222,7 @@ func Test_internalIssueFieldContextServiceImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", payload: payloadMocked, }, @@ -253,7 +253,7 @@ func Test_internalIssueFieldContextServiceImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", payload: payloadMocked, }, @@ -284,7 +284,7 @@ func Test_internalIssueFieldContextServiceImpl_Create(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "", payload: payloadMocked, }, @@ -296,7 +296,7 @@ func Test_internalIssueFieldContextServiceImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", payload: payloadMocked, }, @@ -376,7 +376,7 @@ func Test_internalIssueFieldContextServiceImpl_GetDefaultValues(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextIds: []int{10001}, startAt: 0, @@ -409,7 +409,7 @@ func Test_internalIssueFieldContextServiceImpl_GetDefaultValues(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextIds: []int{10001}, startAt: 0, @@ -442,7 +442,7 @@ func Test_internalIssueFieldContextServiceImpl_GetDefaultValues(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "", }, wantErr: true, @@ -453,7 +453,7 @@ func Test_internalIssueFieldContextServiceImpl_GetDefaultValues(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextIds: []int{10001}, startAt: 0, @@ -550,7 +550,7 @@ func Test_internalIssueFieldContextServiceImpl_SetDefaultValue(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", payload: payloadMocked, }, @@ -581,7 +581,7 @@ func Test_internalIssueFieldContextServiceImpl_SetDefaultValue(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", payload: payloadMocked, }, @@ -612,7 +612,7 @@ func Test_internalIssueFieldContextServiceImpl_SetDefaultValue(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "", }, wantErr: true, @@ -623,7 +623,7 @@ func Test_internalIssueFieldContextServiceImpl_SetDefaultValue(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", payload: payloadMocked, }, @@ -702,7 +702,7 @@ func Test_internalIssueFieldContextServiceImpl_IssueTypesContext(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextIds: []int{10001}, startAt: 0, @@ -735,7 +735,7 @@ func Test_internalIssueFieldContextServiceImpl_IssueTypesContext(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextIds: []int{10001}, startAt: 0, @@ -768,7 +768,7 @@ func Test_internalIssueFieldContextServiceImpl_IssueTypesContext(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "", }, wantErr: true, @@ -779,7 +779,7 @@ func Test_internalIssueFieldContextServiceImpl_IssueTypesContext(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextIds: []int{10001}, startAt: 0, @@ -862,7 +862,7 @@ func Test_internalIssueFieldContextServiceImpl_ProjectsContext(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextIds: []int{10001}, startAt: 0, @@ -895,7 +895,7 @@ func Test_internalIssueFieldContextServiceImpl_ProjectsContext(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextIds: []int{10001}, startAt: 0, @@ -928,7 +928,7 @@ func Test_internalIssueFieldContextServiceImpl_ProjectsContext(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "", }, wantErr: true, @@ -939,7 +939,7 @@ func Test_internalIssueFieldContextServiceImpl_ProjectsContext(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextIds: []int{10001}, startAt: 0, @@ -1026,7 +1026,7 @@ func Test_internalIssueFieldContextServiceImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, name: "DUMMY - customfield_10002 Context", @@ -1059,7 +1059,7 @@ func Test_internalIssueFieldContextServiceImpl_Update(t *testing.T) { name: "when the description is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, name: "DUMMY - customfield_10002 Context", @@ -1092,7 +1092,7 @@ func Test_internalIssueFieldContextServiceImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, name: "DUMMY - customfield_10002 Context", @@ -1125,7 +1125,7 @@ func Test_internalIssueFieldContextServiceImpl_Update(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "", }, wantErr: true, @@ -1136,7 +1136,7 @@ func Test_internalIssueFieldContextServiceImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, name: "DUMMY - customfield_10002 Context", @@ -1217,7 +1217,7 @@ func Test_internalIssueFieldContextServiceImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, }, @@ -1248,7 +1248,7 @@ func Test_internalIssueFieldContextServiceImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, }, @@ -1279,7 +1279,7 @@ func Test_internalIssueFieldContextServiceImpl_Delete(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "", }, wantErr: true, @@ -1290,7 +1290,7 @@ func Test_internalIssueFieldContextServiceImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, }, @@ -1371,7 +1371,7 @@ func Test_internalIssueFieldContextServiceImpl_AddIssueTypes(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, issueTypesIds: []string{"4", "3"}, @@ -1403,7 +1403,7 @@ func Test_internalIssueFieldContextServiceImpl_AddIssueTypes(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, issueTypesIds: []string{"4", "3"}, @@ -1435,7 +1435,7 @@ func Test_internalIssueFieldContextServiceImpl_AddIssueTypes(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "", }, wantErr: true, @@ -1446,7 +1446,7 @@ func Test_internalIssueFieldContextServiceImpl_AddIssueTypes(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, issueTypesIds: []string{"4", "3"}, @@ -1529,7 +1529,7 @@ func Test_internalIssueFieldContextServiceImpl_RemoveIssueTypes(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, issueTypesIds: []string{"4", "3"}, @@ -1561,7 +1561,7 @@ func Test_internalIssueFieldContextServiceImpl_RemoveIssueTypes(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, issueTypesIds: []string{"4", "3"}, @@ -1593,7 +1593,7 @@ func Test_internalIssueFieldContextServiceImpl_RemoveIssueTypes(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "", }, wantErr: true, @@ -1604,7 +1604,7 @@ func Test_internalIssueFieldContextServiceImpl_RemoveIssueTypes(t *testing.T) { name: "when the issuetype id's are not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", issueTypesIds: nil, }, @@ -1616,7 +1616,7 @@ func Test_internalIssueFieldContextServiceImpl_RemoveIssueTypes(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, issueTypesIds: []string{"4", "3"}, @@ -1699,7 +1699,7 @@ func Test_internalIssueFieldContextServiceImpl_Link(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, projectIds: []string{"4", "3"}, @@ -1731,7 +1731,7 @@ func Test_internalIssueFieldContextServiceImpl_Link(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, projectIds: []string{"4", "3"}, @@ -1763,7 +1763,7 @@ func Test_internalIssueFieldContextServiceImpl_Link(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "", }, wantErr: true, @@ -1774,7 +1774,7 @@ func Test_internalIssueFieldContextServiceImpl_Link(t *testing.T) { name: "when the context id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", }, wantErr: true, @@ -1785,7 +1785,7 @@ func Test_internalIssueFieldContextServiceImpl_Link(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, }, @@ -1797,7 +1797,7 @@ func Test_internalIssueFieldContextServiceImpl_Link(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, projectIds: []string{"4", "3"}, @@ -1880,7 +1880,7 @@ func Test_internalIssueFieldContextServiceImpl_Unlink(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, projectIds: []string{"4", "3"}, @@ -1912,7 +1912,7 @@ func Test_internalIssueFieldContextServiceImpl_Unlink(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, projectIds: []string{"4", "3"}, @@ -1944,7 +1944,7 @@ func Test_internalIssueFieldContextServiceImpl_Unlink(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "", }, wantErr: true, @@ -1955,7 +1955,7 @@ func Test_internalIssueFieldContextServiceImpl_Unlink(t *testing.T) { name: "when the context id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", }, wantErr: true, @@ -1966,7 +1966,7 @@ func Test_internalIssueFieldContextServiceImpl_Unlink(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, }, @@ -1978,7 +1978,7 @@ func Test_internalIssueFieldContextServiceImpl_Unlink(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, projectIds: []string{"4", "3"}, diff --git a/jira/internal/field_context_option_impl_test.go b/jira/internal/field_context_option_impl_test.go index 18162b84..c206f0cd 100644 --- a/jira/internal/field_context_option_impl_test.go +++ b/jira/internal/field_context_option_impl_test.go @@ -38,7 +38,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, options: &model.FieldOptionContextParams{ @@ -75,7 +75,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, options: &model.FieldOptionContextParams{ @@ -112,7 +112,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Gets(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "", contextId: 10001, options: &model.FieldOptionContextParams{ @@ -130,7 +130,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, options: &model.FieldOptionContextParams{ @@ -232,7 +232,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, payload: payloadMocked, @@ -264,7 +264,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, payload: payloadMocked, @@ -296,7 +296,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Create(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "", contextId: 10001, }, @@ -308,7 +308,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Create(t *testing.T) { name: "when the context id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "customfield_1000", contextId: 0, }, @@ -320,7 +320,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, payload: payloadMocked, @@ -417,7 +417,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, payload: payloadMocked, @@ -449,7 +449,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, payload: payloadMocked, @@ -481,7 +481,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Update(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "", contextId: 10001, }, @@ -493,7 +493,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Update(t *testing.T) { name: "when the context id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "customfield_1000", contextId: 0, }, @@ -505,7 +505,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, payload: payloadMocked, @@ -587,7 +587,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, optionId: 1001, @@ -619,7 +619,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, optionId: 1001, @@ -651,7 +651,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Delete(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "", contextId: 10001, }, @@ -663,7 +663,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Delete(t *testing.T) { name: "when the context id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "customfield_1000", contextId: 0, }, @@ -675,7 +675,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Delete(t *testing.T) { name: "when the option id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "customfield_1000", contextId: 1000, optionId: 0, @@ -689,7 +689,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, optionId: 1001, @@ -775,7 +775,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Order(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, payload: payloadMocked, @@ -807,7 +807,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Order(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, payload: payloadMocked, @@ -839,7 +839,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Order(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "", contextId: 10001, }, @@ -851,7 +851,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Order(t *testing.T) { name: "when the context id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "customfield_1000", contextId: 0, }, @@ -863,7 +863,7 @@ func Test_internalIssueFieldContextOptionServiceImpl_Order(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "custom_field_10002", contextId: 10001, payload: payloadMocked, diff --git a/jira/internal/field_impl_test.go b/jira/internal/field_impl_test.go index 3e44d473..b5df41a2 100644 --- a/jira/internal/field_impl_test.go +++ b/jira/internal/field_impl_test.go @@ -35,7 +35,7 @@ func Test_internalIssueFieldServiceImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -65,7 +65,7 @@ func Test_internalIssueFieldServiceImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -95,7 +95,7 @@ func Test_internalIssueFieldServiceImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -179,7 +179,7 @@ func Test_internalIssueFieldServiceImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -210,7 +210,7 @@ func Test_internalIssueFieldServiceImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -241,7 +241,7 @@ func Test_internalIssueFieldServiceImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -319,7 +319,7 @@ func Test_internalIssueFieldServiceImpl_Search(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.FieldSearchOptionsScheme{ Types: []string{"custom"}, IDs: []string{"111", "12222"}, @@ -358,7 +358,7 @@ func Test_internalIssueFieldServiceImpl_Search(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.FieldSearchOptionsScheme{ Types: []string{"custom"}, IDs: []string{"111", "12222"}, @@ -397,7 +397,7 @@ func Test_internalIssueFieldServiceImpl_Search(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.FieldSearchOptionsScheme{ Types: []string{"custom"}, IDs: []string{"111", "12222"}, @@ -431,7 +431,7 @@ func Test_internalIssueFieldServiceImpl_Search(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -509,7 +509,7 @@ func Test_internalIssueFieldServiceImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "10005", }, on: func(fields *fields) { @@ -540,7 +540,7 @@ func Test_internalIssueFieldServiceImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "10005", }, on: func(fields *fields) { @@ -571,7 +571,7 @@ func Test_internalIssueFieldServiceImpl_Delete(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "", }, wantErr: true, @@ -582,7 +582,7 @@ func Test_internalIssueFieldServiceImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "10005", }, on: func(fields *fields) { diff --git a/jira/internal/field_trash_impl_test.go b/jira/internal/field_trash_impl_test.go index 93f39c69..cf05fc1e 100644 --- a/jira/internal/field_trash_impl_test.go +++ b/jira/internal/field_trash_impl_test.go @@ -36,7 +36,7 @@ func Test_internalFieldTrashServiceImpl_Search(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.FieldSearchOptionsScheme{ IDs: []string{"111", "12222"}, Query: "query-sample", @@ -73,7 +73,7 @@ func Test_internalFieldTrashServiceImpl_Search(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.FieldSearchOptionsScheme{ IDs: []string{"111", "12222"}, Query: "query-sample", @@ -110,7 +110,7 @@ func Test_internalFieldTrashServiceImpl_Search(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.FieldSearchOptionsScheme{ IDs: []string{"111", "12222"}, Query: "query-sample", @@ -142,7 +142,7 @@ func Test_internalFieldTrashServiceImpl_Search(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -220,7 +220,7 @@ func Test_internalFieldTrashServiceImpl_Move(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: "customfield_12000", }, on: func(fields *fields) { @@ -251,7 +251,7 @@ func Test_internalFieldTrashServiceImpl_Move(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: "customfield_12000", }, on: func(fields *fields) { @@ -282,7 +282,7 @@ func Test_internalFieldTrashServiceImpl_Move(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: "", }, wantErr: true, @@ -293,7 +293,7 @@ func Test_internalFieldTrashServiceImpl_Move(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: "customfield_12000", }, on: func(fields *fields) { @@ -370,7 +370,7 @@ func Test_internalFieldTrashServiceImpl_Restore(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: "customfield_12000", }, on: func(fields *fields) { @@ -401,7 +401,7 @@ func Test_internalFieldTrashServiceImpl_Restore(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: "customfield_12000", }, on: func(fields *fields) { @@ -432,7 +432,7 @@ func Test_internalFieldTrashServiceImpl_Restore(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: "", }, wantErr: true, @@ -443,7 +443,7 @@ func Test_internalFieldTrashServiceImpl_Restore(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), id: "customfield_12000", }, on: func(fields *fields) { diff --git a/jira/internal/group_impl_test.go b/jira/internal/group_impl_test.go index 24b925bc..87b85a93 100644 --- a/jira/internal/group_impl_test.go +++ b/jira/internal/group_impl_test.go @@ -35,7 +35,7 @@ func Test_internalGroupServiceImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "jira-users", }, on: func(fields *fields) { @@ -63,7 +63,7 @@ func Test_internalGroupServiceImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "jira-users", }, on: func(fields *fields) { @@ -91,7 +91,7 @@ func Test_internalGroupServiceImpl_Create(t *testing.T) { name: "when the group name is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "", }, on: func(fields *fields) { @@ -105,7 +105,7 @@ func Test_internalGroupServiceImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "jira-users", }, on: func(fields *fields) { @@ -181,7 +181,7 @@ func Test_internalGroupServiceImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "jira-users", }, on: func(fields *fields) { @@ -209,7 +209,7 @@ func Test_internalGroupServiceImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "jira-users", }, on: func(fields *fields) { @@ -237,7 +237,7 @@ func Test_internalGroupServiceImpl_Delete(t *testing.T) { name: "when the group name is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "", }, on: func(fields *fields) { @@ -251,7 +251,7 @@ func Test_internalGroupServiceImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "jira-users", }, on: func(fields *fields) { @@ -327,7 +327,7 @@ func Test_internalGroupServiceImpl_Remove(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "jira-users", accountId: "account-id-sample", }, @@ -356,7 +356,7 @@ func Test_internalGroupServiceImpl_Remove(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "jira-users", accountId: "account-id-sample", }, @@ -385,7 +385,7 @@ func Test_internalGroupServiceImpl_Remove(t *testing.T) { name: "when the group name is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "", }, on: func(fields *fields) { @@ -399,7 +399,7 @@ func Test_internalGroupServiceImpl_Remove(t *testing.T) { name: "when the account id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "jira-users", accountId: "", }, @@ -414,7 +414,7 @@ func Test_internalGroupServiceImpl_Remove(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "jira-users", accountId: "account-id-sample", }, @@ -491,7 +491,7 @@ func Test_internalGroupServiceImpl_Add(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "jira-users", accountId: "account-id-sample", }, @@ -520,7 +520,7 @@ func Test_internalGroupServiceImpl_Add(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "jira-users", accountId: "account-id-sample", }, @@ -549,7 +549,7 @@ func Test_internalGroupServiceImpl_Add(t *testing.T) { name: "when the group name is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "", }, on: func(fields *fields) { @@ -563,7 +563,7 @@ func Test_internalGroupServiceImpl_Add(t *testing.T) { name: "when the account id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "jira-users", accountId: "", }, @@ -578,7 +578,7 @@ func Test_internalGroupServiceImpl_Add(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "jira-users", accountId: "account-id-sample", }, @@ -656,7 +656,7 @@ func Test_internalGroupServiceImpl_Bulk(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.GroupBulkOptionsScheme{ GroupIDs: []string{"1001", "1002"}, GroupNames: []string{"jira-users", "confluence-users"}, @@ -689,7 +689,7 @@ func Test_internalGroupServiceImpl_Bulk(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.GroupBulkOptionsScheme{ GroupIDs: []string{"1001", "1002"}, GroupNames: []string{"jira-users", "confluence-users"}, @@ -722,7 +722,7 @@ func Test_internalGroupServiceImpl_Bulk(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.GroupBulkOptionsScheme{ GroupIDs: []string{"1001", "1002"}, GroupNames: []string{"jira-users", "confluence-users"}, @@ -806,7 +806,7 @@ func Test_internalGroupServiceImpl_Members(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "jira-users", inactive: true, startAt: 0, @@ -837,7 +837,7 @@ func Test_internalGroupServiceImpl_Members(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "jira-users", inactive: true, startAt: 0, @@ -868,7 +868,7 @@ func Test_internalGroupServiceImpl_Members(t *testing.T) { name: "when the group name is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "", inactive: true, startAt: 0, @@ -885,7 +885,7 @@ func Test_internalGroupServiceImpl_Members(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), groupName: "jira-users", inactive: true, startAt: 0, diff --git a/jira/internal/issue_impl_adf_test.go b/jira/internal/issue_impl_adf_test.go index dd0fbc4c..0ff9e116 100644 --- a/jira/internal/issue_impl_adf_test.go +++ b/jira/internal/issue_impl_adf_test.go @@ -36,7 +36,7 @@ func Test_internalIssueADFServiceImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", deleteSubTasks: true, }, @@ -65,7 +65,7 @@ func Test_internalIssueADFServiceImpl_Delete(t *testing.T) { name: "when the issue issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", deleteSubTasks: true, }, @@ -80,7 +80,7 @@ func Test_internalIssueADFServiceImpl_Delete(t *testing.T) { name: "when the request method cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", deleteSubTasks: true, }, @@ -157,7 +157,7 @@ func Test_internalIssueADFServiceImpl_Assign(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", accountId: "account-id-sample", }, @@ -186,7 +186,7 @@ func Test_internalIssueADFServiceImpl_Assign(t *testing.T) { name: "when the issue issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", accountId: "account-id-sample", }, @@ -201,7 +201,7 @@ func Test_internalIssueADFServiceImpl_Assign(t *testing.T) { name: "when the account id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", accountId: "", }, @@ -216,7 +216,7 @@ func Test_internalIssueADFServiceImpl_Assign(t *testing.T) { name: "when the request method cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", accountId: "account-id-sample", }, @@ -303,7 +303,7 @@ func Test_internalIssueADFServiceImpl_Notify(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", options: optionsMocked, }, @@ -332,7 +332,7 @@ func Test_internalIssueADFServiceImpl_Notify(t *testing.T) { name: "when the issue issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", }, on: func(fields *fields) { @@ -346,7 +346,7 @@ func Test_internalIssueADFServiceImpl_Notify(t *testing.T) { name: "when the request method cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", options: optionsMocked, }, @@ -423,7 +423,7 @@ func Test_internalIssueADFServiceImpl_Transitions(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", }, on: func(fields *fields) { @@ -451,7 +451,7 @@ func Test_internalIssueADFServiceImpl_Transitions(t *testing.T) { name: "when the issue issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", }, on: func(fields *fields) { @@ -465,7 +465,7 @@ func Test_internalIssueADFServiceImpl_Transitions(t *testing.T) { name: "when the request method cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", }, on: func(fields *fields) { @@ -573,7 +573,7 @@ func Test_internalIssueADFServiceImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, customFields: customFieldsMocked, }, @@ -602,7 +602,7 @@ func Test_internalIssueADFServiceImpl_Create(t *testing.T) { name: "when the customfield are not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, customFields: nil, }, @@ -631,7 +631,7 @@ func Test_internalIssueADFServiceImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, customFields: customFieldsMocked, }, @@ -768,7 +768,7 @@ func Test_internalIssueADFServiceImpl_Creates(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -796,7 +796,7 @@ func Test_internalIssueADFServiceImpl_Creates(t *testing.T) { name: "when the payload is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: nil, }, on: func(fields *fields) { @@ -810,7 +810,7 @@ func Test_internalIssueADFServiceImpl_Creates(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -901,7 +901,7 @@ func Test_internalIssueADFServiceImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", fields: []string{"summary", "status"}, expand: []string{"operations", "changelogts"}, @@ -931,7 +931,7 @@ func Test_internalIssueADFServiceImpl_Get(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", fields: []string{"summary", "status"}, expand: []string{"operations", "changelogts"}, @@ -947,7 +947,7 @@ func Test_internalIssueADFServiceImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", fields: []string{"summary", "status"}, expand: []string{"operations", "changelogts"}, @@ -1088,7 +1088,7 @@ func Test_internalIssueADFServiceImpl_Move(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", transitionId: "10001", options: &model.IssueMoveOptionsV3{ @@ -1128,7 +1128,7 @@ func Test_internalIssueADFServiceImpl_Move(t *testing.T) { name: "when the options are provided and the fields are not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", transitionId: "10001", options: &model.IssueMoveOptionsV3{ @@ -1144,7 +1144,7 @@ func Test_internalIssueADFServiceImpl_Move(t *testing.T) { name: "when the operations are not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", transitionId: "10001", options: &model.IssueMoveOptionsV3{ @@ -1184,7 +1184,7 @@ func Test_internalIssueADFServiceImpl_Move(t *testing.T) { name: "when the custom fields are not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", transitionId: "10001", options: &model.IssueMoveOptionsV3{ @@ -1224,7 +1224,7 @@ func Test_internalIssueADFServiceImpl_Move(t *testing.T) { name: "when the the issue comment options are not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", transitionId: "10001", options: nil, @@ -1254,7 +1254,7 @@ func Test_internalIssueADFServiceImpl_Move(t *testing.T) { name: "when the issue key is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", transitionId: "10001", options: &model.IssueMoveOptionsV3{ @@ -1280,7 +1280,7 @@ func Test_internalIssueADFServiceImpl_Move(t *testing.T) { name: "when the transition id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", transitionId: "", options: &model.IssueMoveOptionsV3{ @@ -1306,7 +1306,7 @@ func Test_internalIssueADFServiceImpl_Move(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", transitionId: "10001", options: &model.IssueMoveOptionsV3{ @@ -1443,7 +1443,7 @@ func Test_internalIssueADFServiceImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", notify: true, payload: &model.IssueScheme{ @@ -1479,7 +1479,7 @@ func Test_internalIssueADFServiceImpl_Update(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", notify: true, payload: &model.IssueScheme{ @@ -1501,7 +1501,7 @@ func Test_internalIssueADFServiceImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", notify: true, payload: &model.IssueScheme{ @@ -1534,7 +1534,7 @@ func Test_internalIssueADFServiceImpl_Update(t *testing.T) { name: "when the operations are not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", notify: true, payload: &model.IssueScheme{ @@ -1570,7 +1570,7 @@ func Test_internalIssueADFServiceImpl_Update(t *testing.T) { name: "when the custom fields are not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", notify: true, payload: &model.IssueScheme{ @@ -1606,7 +1606,7 @@ func Test_internalIssueADFServiceImpl_Update(t *testing.T) { name: "when the operations are customfields are not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", notify: true, payload: &model.IssueScheme{ diff --git a/jira/internal/issue_impl_rich_text_test.go b/jira/internal/issue_impl_rich_text_test.go index 843328ba..41209f9d 100644 --- a/jira/internal/issue_impl_rich_text_test.go +++ b/jira/internal/issue_impl_rich_text_test.go @@ -36,7 +36,7 @@ func Test_internalRichTextServiceImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", deleteSubTasks: true, }, @@ -65,7 +65,7 @@ func Test_internalRichTextServiceImpl_Delete(t *testing.T) { name: "when the issue issue key or id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", deleteSubTasks: true, }, @@ -80,7 +80,7 @@ func Test_internalRichTextServiceImpl_Delete(t *testing.T) { name: "when the request method cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", deleteSubTasks: true, }, @@ -157,7 +157,7 @@ func Test_internalRichTextServiceImpl_Assign(t *testing.T) { name: "when the api version is v3", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", accountId: "account-id-sample", }, @@ -186,7 +186,7 @@ func Test_internalRichTextServiceImpl_Assign(t *testing.T) { name: "when the issue issue key or id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", accountId: "account-id-sample", }, @@ -201,7 +201,7 @@ func Test_internalRichTextServiceImpl_Assign(t *testing.T) { name: "when the account id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", accountId: "", }, @@ -216,7 +216,7 @@ func Test_internalRichTextServiceImpl_Assign(t *testing.T) { name: "when the request method cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", accountId: "account-id-sample", }, @@ -303,7 +303,7 @@ func Test_internalRichTextServiceImpl_Notify(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", options: optionsMocked, }, @@ -332,7 +332,7 @@ func Test_internalRichTextServiceImpl_Notify(t *testing.T) { name: "when the issue issue key or id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", }, on: func(fields *fields) { @@ -346,7 +346,7 @@ func Test_internalRichTextServiceImpl_Notify(t *testing.T) { name: "when the request method cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", options: optionsMocked, }, @@ -423,7 +423,7 @@ func Test_internalRichTextServiceImpl_Transitions(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", }, on: func(fields *fields) { @@ -451,7 +451,7 @@ func Test_internalRichTextServiceImpl_Transitions(t *testing.T) { name: "when the issue issue key or id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", }, on: func(fields *fields) { @@ -465,7 +465,7 @@ func Test_internalRichTextServiceImpl_Transitions(t *testing.T) { name: "when the request method cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", }, on: func(fields *fields) { @@ -573,7 +573,7 @@ func Test_internalRichTextServiceImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, customFields: customFieldsMocked, }, @@ -602,7 +602,7 @@ func Test_internalRichTextServiceImpl_Create(t *testing.T) { name: "when the customfield are not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, customFields: nil, }, @@ -631,7 +631,7 @@ func Test_internalRichTextServiceImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, customFields: customFieldsMocked, }, @@ -768,7 +768,7 @@ func Test_internalRichTextServiceImpl_Creates(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -796,7 +796,7 @@ func Test_internalRichTextServiceImpl_Creates(t *testing.T) { name: "when the payload is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: nil, }, on: func(fields *fields) { @@ -810,7 +810,7 @@ func Test_internalRichTextServiceImpl_Creates(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -901,7 +901,7 @@ func Test_internalRichTextServiceImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", fields: []string{"summary", "status"}, expand: []string{"operations", "changelogts"}, @@ -931,7 +931,7 @@ func Test_internalRichTextServiceImpl_Get(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", fields: []string{"summary", "status"}, expand: []string{"operations", "changelogts"}, @@ -947,7 +947,7 @@ func Test_internalRichTextServiceImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", fields: []string{"summary", "status"}, expand: []string{"operations", "changelogts"}, @@ -1087,7 +1087,7 @@ func Test_internalRichTextServiceImpl_Move(t *testing.T) { name: "when the api version is v3", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", transitionId: "10001", options: &model.IssueMoveOptionsV2{ @@ -1127,7 +1127,7 @@ func Test_internalRichTextServiceImpl_Move(t *testing.T) { name: "when the options are provided and the fields are not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", transitionId: "10001", options: &model.IssueMoveOptionsV2{ @@ -1143,7 +1143,7 @@ func Test_internalRichTextServiceImpl_Move(t *testing.T) { name: "when the operations are not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", transitionId: "10001", options: &model.IssueMoveOptionsV2{ @@ -1183,7 +1183,7 @@ func Test_internalRichTextServiceImpl_Move(t *testing.T) { name: "when the custom fields are not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", transitionId: "10001", options: &model.IssueMoveOptionsV2{ @@ -1223,7 +1223,7 @@ func Test_internalRichTextServiceImpl_Move(t *testing.T) { name: "when the the issue comment options are not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", transitionId: "10001", options: nil, @@ -1253,7 +1253,7 @@ func Test_internalRichTextServiceImpl_Move(t *testing.T) { name: "when the issue key is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", transitionId: "10001", options: &model.IssueMoveOptionsV2{ @@ -1279,7 +1279,7 @@ func Test_internalRichTextServiceImpl_Move(t *testing.T) { name: "when the transition id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", transitionId: "", options: &model.IssueMoveOptionsV2{ @@ -1305,7 +1305,7 @@ func Test_internalRichTextServiceImpl_Move(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", transitionId: "10001", options: &model.IssueMoveOptionsV2{ @@ -1442,7 +1442,7 @@ func Test_internalRichTextServiceImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", notify: true, payload: &model.IssueSchemeV2{ @@ -1478,7 +1478,7 @@ func Test_internalRichTextServiceImpl_Update(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", notify: true, payload: &model.IssueSchemeV2{ @@ -1500,7 +1500,7 @@ func Test_internalRichTextServiceImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", notify: true, payload: &model.IssueSchemeV2{ @@ -1533,7 +1533,7 @@ func Test_internalRichTextServiceImpl_Update(t *testing.T) { name: "when the operations are not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", notify: true, payload: &model.IssueSchemeV2{ @@ -1569,7 +1569,7 @@ func Test_internalRichTextServiceImpl_Update(t *testing.T) { name: "when the custom fields are not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", notify: true, payload: &model.IssueSchemeV2{ @@ -1605,7 +1605,7 @@ func Test_internalRichTextServiceImpl_Update(t *testing.T) { name: "when the operations are customfields are not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-1", notify: true, payload: &model.IssueSchemeV2{ diff --git a/jira/internal/issue_property_impl_test.go b/jira/internal/issue_property_impl_test.go index 13a9645c..1615b1f5 100644 --- a/jira/internal/issue_property_impl_test.go +++ b/jira/internal/issue_property_impl_test.go @@ -93,7 +93,7 @@ func Test_internalIssuePropertyImpl_Gets(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoIssueKeyOrIDError, diff --git a/jira/internal/jql_impl_test.go b/jira/internal/jql_impl_test.go index 7dd00910..a8dc5798 100644 --- a/jira/internal/jql_impl_test.go +++ b/jira/internal/jql_impl_test.go @@ -46,7 +46,7 @@ func Test_internalJQLServiceImpl_Parse(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), validationType: "strict", JqlQueries: []string{ "summary ~ test AND (labels in (urgent, blocker) OR lastCommentedBy = currentUser()) AND status CHANGED AFTER startOfMonth(-1M) ORDER BY updated DESC", @@ -83,7 +83,7 @@ func Test_internalJQLServiceImpl_Parse(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), validationType: "strict", JqlQueries: []string{ "summary ~ test AND (labels in (urgent, blocker) OR lastCommentedBy = currentUser()) AND status CHANGED AFTER startOfMonth(-1M) ORDER BY updated DESC", @@ -120,7 +120,7 @@ func Test_internalJQLServiceImpl_Parse(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), validationType: "strict", JqlQueries: []string{ "summary ~ test AND (labels in (urgent, blocker) OR lastCommentedBy = currentUser()) AND status CHANGED AFTER startOfMonth(-1M) ORDER BY updated DESC", diff --git a/jira/internal/label_impl_test.go b/jira/internal/label_impl_test.go index e3cd0a14..1108c355 100644 --- a/jira/internal/label_impl_test.go +++ b/jira/internal/label_impl_test.go @@ -35,7 +35,7 @@ func Test_internalLabelServiceImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), startAt: 50, maxResults: 50, }, @@ -66,7 +66,7 @@ func Test_internalLabelServiceImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), startAt: 50, maxResults: 50, }, @@ -97,7 +97,7 @@ func Test_internalLabelServiceImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), startAt: 50, maxResults: 50, }, diff --git a/jira/internal/link_impl_adf_test.go b/jira/internal/link_impl_adf_test.go index df4eae3c..c3464699 100644 --- a/jira/internal/link_impl_adf_test.go +++ b/jira/internal/link_impl_adf_test.go @@ -35,7 +35,7 @@ func Test_internalLinkADFServiceImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), linkId: "10002", }, on: func(fields *fields) { @@ -65,7 +65,7 @@ func Test_internalLinkADFServiceImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), linkId: "10002", }, on: func(fields *fields) { @@ -95,7 +95,7 @@ func Test_internalLinkADFServiceImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), linkId: "10002", }, on: func(fields *fields) { @@ -120,7 +120,7 @@ func Test_internalLinkADFServiceImpl_Get(t *testing.T) { name: "when the issue link is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), linkId: "", }, wantErr: true, @@ -183,7 +183,7 @@ func Test_internalLinkADFServiceImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-4", }, on: func(fields *fields) { @@ -213,7 +213,7 @@ func Test_internalLinkADFServiceImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-4", }, on: func(fields *fields) { @@ -243,7 +243,7 @@ func Test_internalLinkADFServiceImpl_Gets(t *testing.T) { name: "when the issue key is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", }, wantErr: true, @@ -254,7 +254,7 @@ func Test_internalLinkADFServiceImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-4", }, on: func(fields *fields) { @@ -331,7 +331,7 @@ func Test_internalLinkADFServiceImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), linkId: "10002", }, on: func(fields *fields) { @@ -361,7 +361,7 @@ func Test_internalLinkADFServiceImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), linkId: "10002", }, on: func(fields *fields) { @@ -391,7 +391,7 @@ func Test_internalLinkADFServiceImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), linkId: "10002", }, on: func(fields *fields) { @@ -416,7 +416,7 @@ func Test_internalLinkADFServiceImpl_Delete(t *testing.T) { name: "when the issue link is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), linkId: "", }, wantErr: true, @@ -515,7 +515,7 @@ func Test_internalLinkADFServiceImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -545,7 +545,7 @@ func Test_internalLinkADFServiceImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -575,7 +575,7 @@ func Test_internalLinkADFServiceImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { diff --git a/jira/internal/link_impl_rich_text_test.go b/jira/internal/link_impl_rich_text_test.go index d444e93b..da895ee8 100644 --- a/jira/internal/link_impl_rich_text_test.go +++ b/jira/internal/link_impl_rich_text_test.go @@ -35,7 +35,7 @@ func Test_internalLinkRichTextServiceImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), linkId: "10002", }, on: func(fields *fields) { @@ -65,7 +65,7 @@ func Test_internalLinkRichTextServiceImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), linkId: "10002", }, on: func(fields *fields) { @@ -95,7 +95,7 @@ func Test_internalLinkRichTextServiceImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), linkId: "10002", }, on: func(fields *fields) { @@ -120,7 +120,7 @@ func Test_internalLinkRichTextServiceImpl_Get(t *testing.T) { name: "when the issue link is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), linkId: "", }, wantErr: true, @@ -183,7 +183,7 @@ func Test_internalLinkRichTextServiceImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-4", }, on: func(fields *fields) { @@ -213,7 +213,7 @@ func Test_internalLinkRichTextServiceImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-4", }, on: func(fields *fields) { @@ -243,7 +243,7 @@ func Test_internalLinkRichTextServiceImpl_Gets(t *testing.T) { name: "when the issue key is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", }, wantErr: true, @@ -254,7 +254,7 @@ func Test_internalLinkRichTextServiceImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-4", }, on: func(fields *fields) { @@ -331,7 +331,7 @@ func Test_internalLinkRichTextServiceImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), linkId: "10002", }, on: func(fields *fields) { @@ -361,7 +361,7 @@ func Test_internalLinkRichTextServiceImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), linkId: "10002", }, on: func(fields *fields) { @@ -391,7 +391,7 @@ func Test_internalLinkRichTextServiceImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), linkId: "10002", }, on: func(fields *fields) { @@ -416,7 +416,7 @@ func Test_internalLinkRichTextServiceImpl_Delete(t *testing.T) { name: "when the issue link is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), linkId: "", }, wantErr: true, @@ -493,7 +493,7 @@ func Test_internalLinkRichTextServiceImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -523,7 +523,7 @@ func Test_internalLinkRichTextServiceImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -553,7 +553,7 @@ func Test_internalLinkRichTextServiceImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { diff --git a/jira/internal/link_type_impl_test.go b/jira/internal/link_type_impl_test.go index 35b3e969..f620b069 100644 --- a/jira/internal/link_type_impl_test.go +++ b/jira/internal/link_type_impl_test.go @@ -34,7 +34,7 @@ func Test_internalLinkTypeImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -63,7 +63,7 @@ func Test_internalLinkTypeImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -92,7 +92,7 @@ func Test_internalLinkTypeImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -168,7 +168,7 @@ func Test_internalLinkTypeImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueLinkTypeId: "1002", }, on: func(fields *fields) { @@ -198,7 +198,7 @@ func Test_internalLinkTypeImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueLinkTypeId: "1002", }, on: func(fields *fields) { @@ -228,7 +228,7 @@ func Test_internalLinkTypeImpl_Get(t *testing.T) { name: "when the issue link type id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueLinkTypeId: "", }, wantErr: true, @@ -239,7 +239,7 @@ func Test_internalLinkTypeImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueLinkTypeId: "1002", }, on: func(fields *fields) { @@ -323,7 +323,7 @@ func Test_internalLinkTypeImpl_Update(t *testing.T) { name: "when the issue link type id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueLinkTypeId: "", }, wantErr: true, @@ -333,7 +333,7 @@ func Test_internalLinkTypeImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueLinkTypeId: "1002", payload: payloadMocked, }, @@ -364,7 +364,7 @@ func Test_internalLinkTypeImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueLinkTypeId: "1002", payload: payloadMocked, }, @@ -395,7 +395,7 @@ func Test_internalLinkTypeImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueLinkTypeId: "1002", payload: payloadMocked, }, @@ -479,7 +479,7 @@ func Test_internalLinkTypeImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -509,7 +509,7 @@ func Test_internalLinkTypeImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -539,7 +539,7 @@ func Test_internalLinkTypeImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -616,7 +616,7 @@ func Test_internalLinkTypeImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueLinkTypeId: "1002", }, on: func(fields *fields) { @@ -646,7 +646,7 @@ func Test_internalLinkTypeImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueLinkTypeId: "1002", }, on: func(fields *fields) { @@ -676,7 +676,7 @@ func Test_internalLinkTypeImpl_Delete(t *testing.T) { name: "when the issue link type id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueLinkTypeId: "", }, wantErr: true, @@ -687,7 +687,7 @@ func Test_internalLinkTypeImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueLinkTypeId: "1002", }, on: func(fields *fields) { diff --git a/jira/internal/metadata_impl_test.go b/jira/internal/metadata_impl_test.go index 17f8a1d1..d5515c97 100644 --- a/jira/internal/metadata_impl_test.go +++ b/jira/internal/metadata_impl_test.go @@ -39,7 +39,7 @@ func Test_internalMetadataImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-4", overrideScreenSecurity: true, overrideEditableFlag: false, @@ -71,7 +71,7 @@ func Test_internalMetadataImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-4", overrideScreenSecurity: true, overrideEditableFlag: false, @@ -103,7 +103,7 @@ func Test_internalMetadataImpl_Get(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", overrideScreenSecurity: true, overrideEditableFlag: false, @@ -117,7 +117,7 @@ func Test_internalMetadataImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-4", overrideScreenSecurity: true, overrideEditableFlag: false, @@ -199,7 +199,7 @@ func Test_internalMetadataImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), opts: &model.IssueMetadataCreateOptions{ ProjectIDs: []string{"1002"}, ProjectKeys: []string{"DUMMY"}, @@ -235,7 +235,7 @@ func Test_internalMetadataImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), opts: &model.IssueMetadataCreateOptions{ ProjectIDs: []string{"1002"}, ProjectKeys: []string{"DUMMY"}, @@ -271,7 +271,7 @@ func Test_internalMetadataImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), opts: &model.IssueMetadataCreateOptions{ ProjectIDs: []string{"1002"}, ProjectKeys: []string{"DUMMY"}, diff --git a/jira/internal/myself_impl_test.go b/jira/internal/myself_impl_test.go index d5ef0307..e90a2006 100644 --- a/jira/internal/myself_impl_test.go +++ b/jira/internal/myself_impl_test.go @@ -35,7 +35,7 @@ func Test_internalMySelfImpl_Details(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), expand: []string{"groups", "applicationRoles"}, }, on: func(fields *fields) { @@ -64,7 +64,7 @@ func Test_internalMySelfImpl_Details(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), expand: []string{"groups", "applicationRoles"}, }, on: func(fields *fields) { @@ -93,7 +93,7 @@ func Test_internalMySelfImpl_Details(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), expand: []string{"groups", "applicationRoles"}, }, on: func(fields *fields) { diff --git a/jira/internal/notification_scheme_impl_test.go b/jira/internal/notification_scheme_impl_test.go index 892dd2b6..c4866f2a 100644 --- a/jira/internal/notification_scheme_impl_test.go +++ b/jira/internal/notification_scheme_impl_test.go @@ -36,7 +36,7 @@ func Test_internalNotificationSchemeImpl_Search(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.NotificationSchemeSearchOptions{ NotificationSchemeIDs: []string{"1000", "1001"}, ProjectIDs: []string{"50001", "50002"}, @@ -72,7 +72,7 @@ func Test_internalNotificationSchemeImpl_Search(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.NotificationSchemeSearchOptions{ NotificationSchemeIDs: []string{"1000", "1001"}, ProjectIDs: []string{"50001", "50002"}, @@ -108,7 +108,7 @@ func Test_internalNotificationSchemeImpl_Search(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.NotificationSchemeSearchOptions{ NotificationSchemeIDs: []string{"1000", "1001"}, ProjectIDs: []string{"50001", "50002"}, @@ -193,7 +193,7 @@ func Test_internalNotificationSchemeImpl_Projects(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeIDs: []string{"scheme-id"}, projectIDs: []string{"10001"}, startAt: 100, @@ -225,7 +225,7 @@ func Test_internalNotificationSchemeImpl_Projects(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeIDs: []string{"scheme-id"}, projectIDs: []string{"10001"}, startAt: 100, @@ -257,7 +257,7 @@ func Test_internalNotificationSchemeImpl_Projects(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeIDs: []string{"scheme-id"}, projectIDs: []string{"10001"}, startAt: 100, @@ -339,7 +339,7 @@ func Test_internalNotificationSchemeImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: "10001", expand: []string{"all"}, }, @@ -369,7 +369,7 @@ func Test_internalNotificationSchemeImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: "10001", expand: []string{"all"}, }, @@ -399,7 +399,7 @@ func Test_internalNotificationSchemeImpl_Get(t *testing.T) { name: "when the notification scheme is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoNotificationSchemeIDError, @@ -409,7 +409,7 @@ func Test_internalNotificationSchemeImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: "10001", expand: []string{"all"}, }, @@ -492,7 +492,7 @@ func Test_internalNotificationSchemeImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: "10001", payload: payloadMocked, }, @@ -522,7 +522,7 @@ func Test_internalNotificationSchemeImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: "10001", payload: payloadMocked, }, @@ -552,7 +552,7 @@ func Test_internalNotificationSchemeImpl_Update(t *testing.T) { name: "when the notification scheme is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoNotificationSchemeIDError, @@ -562,7 +562,7 @@ func Test_internalNotificationSchemeImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: "10001", payload: payloadMocked, }, @@ -655,7 +655,7 @@ func Test_internalNotificationSchemeImpl_Append(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: "10001", payload: payloadMocked, }, @@ -685,7 +685,7 @@ func Test_internalNotificationSchemeImpl_Append(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: "10001", payload: payloadMocked, }, @@ -715,7 +715,7 @@ func Test_internalNotificationSchemeImpl_Append(t *testing.T) { name: "when the notification scheme is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoNotificationSchemeIDError, @@ -725,7 +725,7 @@ func Test_internalNotificationSchemeImpl_Append(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: "10001", payload: payloadMocked, }, @@ -802,7 +802,7 @@ func Test_internalNotificationSchemeImpl_Remove(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: "10001", notificationID: "10001", }, @@ -832,7 +832,7 @@ func Test_internalNotificationSchemeImpl_Remove(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: "10001", notificationID: "10001", }, @@ -862,7 +862,7 @@ func Test_internalNotificationSchemeImpl_Remove(t *testing.T) { name: "when the notification scheme is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoNotificationSchemeIDError, @@ -872,7 +872,7 @@ func Test_internalNotificationSchemeImpl_Remove(t *testing.T) { name: "when the notification id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: "10001", }, wantErr: true, @@ -883,7 +883,7 @@ func Test_internalNotificationSchemeImpl_Remove(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: "10001", notificationID: "10001", }, @@ -959,7 +959,7 @@ func Test_internalNotificationSchemeImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: "10001", }, on: func(fields *fields) { @@ -988,7 +988,7 @@ func Test_internalNotificationSchemeImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: "10001", }, on: func(fields *fields) { @@ -1017,7 +1017,7 @@ func Test_internalNotificationSchemeImpl_Delete(t *testing.T) { name: "when the notification scheme is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoNotificationSchemeIDError, @@ -1027,7 +1027,7 @@ func Test_internalNotificationSchemeImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: "10001", }, on: func(fields *fields) { @@ -1120,7 +1120,7 @@ func Test_internalNotificationSchemeImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -1149,7 +1149,7 @@ func Test_internalNotificationSchemeImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -1178,7 +1178,7 @@ func Test_internalNotificationSchemeImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { diff --git a/jira/internal/permission_impl_test.go b/jira/internal/permission_impl_test.go index 4d538d20..eee3e103 100644 --- a/jira/internal/permission_impl_test.go +++ b/jira/internal/permission_impl_test.go @@ -50,7 +50,7 @@ func Test_internalPermissionImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -79,7 +79,7 @@ func Test_internalPermissionImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -108,7 +108,7 @@ func Test_internalPermissionImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -132,7 +132,7 @@ func Test_internalPermissionImpl_Gets(t *testing.T) { name: "when the response cannot be parsed", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -238,7 +238,7 @@ func Test_internalPermissionImpl_Checks(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -268,7 +268,7 @@ func Test_internalPermissionImpl_Checks(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -298,7 +298,7 @@ func Test_internalPermissionImpl_Checks(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -377,7 +377,7 @@ func Test_internalPermissionImpl_Projects(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissions: []string{"EDIT_ISSUES", "CREATE_ISSUES"}, }, on: func(fields *fields) { @@ -407,7 +407,7 @@ func Test_internalPermissionImpl_Projects(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissions: []string{"EDIT_ISSUES", "CREATE_ISSUES"}, }, on: func(fields *fields) { @@ -437,7 +437,7 @@ func Test_internalPermissionImpl_Projects(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissions: []string{"EDIT_ISSUES", "CREATE_ISSUES"}, }, on: func(fields *fields) { @@ -462,7 +462,7 @@ func Test_internalPermissionImpl_Projects(t *testing.T) { name: "when the permission keys are not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoPermissionKeysError, diff --git a/jira/internal/permission_scheme_grant_impl_test.go b/jira/internal/permission_scheme_grant_impl_test.go index 16b16c07..17a8bd72 100644 --- a/jira/internal/permission_scheme_grant_impl_test.go +++ b/jira/internal/permission_scheme_grant_impl_test.go @@ -44,7 +44,7 @@ func TestPermissionSchemeGrantService_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, payload: payloadMocked, }, @@ -74,7 +74,7 @@ func TestPermissionSchemeGrantService_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, payload: payloadMocked, }, @@ -104,7 +104,7 @@ func TestPermissionSchemeGrantService_Create(t *testing.T) { name: "when the permission scheme id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoPermissionSchemeIDError, @@ -114,7 +114,7 @@ func TestPermissionSchemeGrantService_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, payload: payloadMocked, }, @@ -192,7 +192,7 @@ func TestPermissionSchemeGrantService_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, expand: []string{"all"}, }, @@ -222,7 +222,7 @@ func TestPermissionSchemeGrantService_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, expand: []string{"all"}, }, @@ -252,7 +252,7 @@ func TestPermissionSchemeGrantService_Gets(t *testing.T) { name: "when the permission scheme id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoPermissionSchemeIDError, @@ -262,7 +262,7 @@ func TestPermissionSchemeGrantService_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, expand: []string{"all"}, }, @@ -341,7 +341,7 @@ func TestPermissionSchemeGrantService_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, permissionGrantId: 30092, expand: []string{"all"}, @@ -372,7 +372,7 @@ func TestPermissionSchemeGrantService_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, permissionGrantId: 30092, expand: []string{"all"}, @@ -403,7 +403,7 @@ func TestPermissionSchemeGrantService_Get(t *testing.T) { name: "when the permission scheme id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoPermissionSchemeIDError, @@ -413,7 +413,7 @@ func TestPermissionSchemeGrantService_Get(t *testing.T) { name: "when the permission scheme grant id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, }, wantErr: true, @@ -424,7 +424,7 @@ func TestPermissionSchemeGrantService_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, permissionGrantId: 30092, expand: []string{"all"}, @@ -504,7 +504,7 @@ func TestPermissionSchemeGrantService_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, permissionGrantId: 30092, }, @@ -534,7 +534,7 @@ func TestPermissionSchemeGrantService_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, permissionGrantId: 30092, }, @@ -564,7 +564,7 @@ func TestPermissionSchemeGrantService_Delete(t *testing.T) { name: "when the permission scheme id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoPermissionSchemeIDError, @@ -574,7 +574,7 @@ func TestPermissionSchemeGrantService_Delete(t *testing.T) { name: "when the permission scheme grant id is not provided", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, }, wantErr: true, @@ -585,7 +585,7 @@ func TestPermissionSchemeGrantService_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, permissionGrantId: 30092, }, diff --git a/jira/internal/permission_scheme_impl_test.go b/jira/internal/permission_scheme_impl_test.go index 554c7e97..6f8007cb 100644 --- a/jira/internal/permission_scheme_impl_test.go +++ b/jira/internal/permission_scheme_impl_test.go @@ -34,7 +34,7 @@ func TestPermissionSchemeService_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -62,7 +62,7 @@ func TestPermissionSchemeService_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -90,7 +90,7 @@ func TestPermissionSchemeService_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -166,7 +166,7 @@ func TestPermissionSchemeService_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, expand: []string{"all"}, }, @@ -196,7 +196,7 @@ func TestPermissionSchemeService_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, expand: []string{"all"}, }, @@ -226,7 +226,7 @@ func TestPermissionSchemeService_Get(t *testing.T) { name: "when the permission scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoPermissionSchemeIDError, @@ -236,7 +236,7 @@ func TestPermissionSchemeService_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, expand: []string{"all"}, }, @@ -313,7 +313,7 @@ func TestPermissionSchemeService_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, }, on: func(fields *fields) { @@ -342,7 +342,7 @@ func TestPermissionSchemeService_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, }, on: func(fields *fields) { @@ -371,7 +371,7 @@ func TestPermissionSchemeService_Delete(t *testing.T) { name: "when the permission scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoPermissionSchemeIDError, @@ -381,7 +381,7 @@ func TestPermissionSchemeService_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, }, on: func(fields *fields) { @@ -477,7 +477,7 @@ func TestPermissionSchemeService_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -506,7 +506,7 @@ func TestPermissionSchemeService_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -535,7 +535,7 @@ func TestPermissionSchemeService_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -633,7 +633,7 @@ func TestPermissionSchemeService_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, payload: payloadMocked, }, @@ -663,7 +663,7 @@ func TestPermissionSchemeService_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, payload: payloadMocked, }, @@ -693,7 +693,7 @@ func TestPermissionSchemeService_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permissionSchemeId: 10001, payload: payloadMocked, }, diff --git a/jira/internal/priority_impl_test.go b/jira/internal/priority_impl_test.go index e5fb208c..0d41ed1c 100644 --- a/jira/internal/priority_impl_test.go +++ b/jira/internal/priority_impl_test.go @@ -35,7 +35,7 @@ func Test_internalPriorityImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -63,7 +63,7 @@ func Test_internalPriorityImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -91,7 +91,7 @@ func Test_internalPriorityImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -166,7 +166,7 @@ func Test_internalPriorityImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), priorityId: "2", }, on: func(fields *fields) { @@ -195,7 +195,7 @@ func Test_internalPriorityImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), priorityId: "2", }, on: func(fields *fields) { @@ -224,7 +224,7 @@ func Test_internalPriorityImpl_Get(t *testing.T) { name: "when the priority id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoPriorityIDError, @@ -234,7 +234,7 @@ func Test_internalPriorityImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), priorityId: "2", }, on: func(fields *fields) { diff --git a/jira/internal/project_category_impl_test.go b/jira/internal/project_category_impl_test.go index 3a645f09..9ce0307a 100644 --- a/jira/internal/project_category_impl_test.go +++ b/jira/internal/project_category_impl_test.go @@ -35,7 +35,7 @@ func Test_internalProjectCategoryImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -63,7 +63,7 @@ func Test_internalProjectCategoryImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -91,7 +91,7 @@ func Test_internalProjectCategoryImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -166,7 +166,7 @@ func Test_internalProjectCategoryImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), categoryId: 10001, }, on: func(fields *fields) { @@ -195,7 +195,7 @@ func Test_internalProjectCategoryImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), categoryId: 10001, }, on: func(fields *fields) { @@ -224,7 +224,7 @@ func Test_internalProjectCategoryImpl_Get(t *testing.T) { name: "when the project category id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectCategoryIDError, @@ -234,7 +234,7 @@ func Test_internalProjectCategoryImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), categoryId: 10001, }, on: func(fields *fields) { @@ -315,7 +315,7 @@ func Test_internalProjectCategoryImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -344,7 +344,7 @@ func Test_internalProjectCategoryImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -373,7 +373,7 @@ func Test_internalProjectCategoryImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -455,7 +455,7 @@ func Test_internalProjectCategoryImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), categoryId: 10001, payload: payloadMocked, }, @@ -485,7 +485,7 @@ func Test_internalProjectCategoryImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), categoryId: 10001, payload: payloadMocked, }, @@ -515,7 +515,7 @@ func Test_internalProjectCategoryImpl_Update(t *testing.T) { name: "when the project category id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectCategoryIDError, @@ -525,7 +525,7 @@ func Test_internalProjectCategoryImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), categoryId: 10001, payload: payloadMocked, }, @@ -602,7 +602,7 @@ func Test_internalProjectCategoryImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), categoryId: 10001, }, on: func(fields *fields) { @@ -631,7 +631,7 @@ func Test_internalProjectCategoryImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), categoryId: 10001, }, on: func(fields *fields) { @@ -660,7 +660,7 @@ func Test_internalProjectCategoryImpl_Delete(t *testing.T) { name: "when the project category id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectCategoryIDError, @@ -670,7 +670,7 @@ func Test_internalProjectCategoryImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), categoryId: 10001, }, on: func(fields *fields) { diff --git a/jira/internal/project_component_impl_test.go b/jira/internal/project_component_impl_test.go index 41b3192c..e0c8f15d 100644 --- a/jira/internal/project_component_impl_test.go +++ b/jira/internal/project_component_impl_test.go @@ -45,7 +45,7 @@ func Test_internalProjectComponentImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -74,7 +74,7 @@ func Test_internalProjectComponentImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -103,7 +103,7 @@ func Test_internalProjectComponentImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -189,7 +189,7 @@ func Test_internalProjectComponentImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), componentId: "10393", payload: payloadMocked, }, @@ -219,7 +219,7 @@ func Test_internalProjectComponentImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), componentId: "10393", payload: payloadMocked, }, @@ -249,7 +249,7 @@ func Test_internalProjectComponentImpl_Update(t *testing.T) { name: "when the component id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoComponentIDError, @@ -259,7 +259,7 @@ func Test_internalProjectComponentImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), componentId: "10393", payload: payloadMocked, }, @@ -336,7 +336,7 @@ func Test_internalProjectComponentImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectIdOrKey: "DUMMY", }, on: func(fields *fields) { @@ -365,7 +365,7 @@ func Test_internalProjectComponentImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectIdOrKey: "DUMMY", }, on: func(fields *fields) { @@ -394,7 +394,7 @@ func Test_internalProjectComponentImpl_Gets(t *testing.T) { name: "when the project key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -404,7 +404,7 @@ func Test_internalProjectComponentImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectIdOrKey: "DUMMY", }, on: func(fields *fields) { @@ -480,7 +480,7 @@ func Test_internalProjectComponentImpl_Count(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), componentId: "10001", }, on: func(fields *fields) { @@ -509,7 +509,7 @@ func Test_internalProjectComponentImpl_Count(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), componentId: "10001", }, on: func(fields *fields) { @@ -538,7 +538,7 @@ func Test_internalProjectComponentImpl_Count(t *testing.T) { name: "when the component id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoComponentIDError, @@ -548,7 +548,7 @@ func Test_internalProjectComponentImpl_Count(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), componentId: "10001", }, on: func(fields *fields) { @@ -624,7 +624,7 @@ func Test_internalProjectComponentImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), componentId: "10001", }, on: func(fields *fields) { @@ -653,7 +653,7 @@ func Test_internalProjectComponentImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), componentId: "10001", }, on: func(fields *fields) { @@ -682,7 +682,7 @@ func Test_internalProjectComponentImpl_Get(t *testing.T) { name: "when the component id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoComponentIDError, @@ -692,7 +692,7 @@ func Test_internalProjectComponentImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), componentId: "10001", }, on: func(fields *fields) { @@ -768,7 +768,7 @@ func Test_internalProjectComponentImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), componentId: "10001", }, on: func(fields *fields) { @@ -797,7 +797,7 @@ func Test_internalProjectComponentImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), componentId: "10001", }, on: func(fields *fields) { @@ -826,7 +826,7 @@ func Test_internalProjectComponentImpl_Delete(t *testing.T) { name: "when the component id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoComponentIDError, @@ -836,7 +836,7 @@ func Test_internalProjectComponentImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), componentId: "10001", }, on: func(fields *fields) { diff --git a/jira/internal/project_feature_impl_test.go b/jira/internal/project_feature_impl_test.go index 1137e44a..85a2eb9f 100644 --- a/jira/internal/project_feature_impl_test.go +++ b/jira/internal/project_feature_impl_test.go @@ -37,7 +37,7 @@ func Test_internalProjectFeatureImpl_Set(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", featureKey: "jsw.classic.roadmap", state: "ENABLED", @@ -68,7 +68,7 @@ func Test_internalProjectFeatureImpl_Set(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", featureKey: "jsw.classic.roadmap", state: "ENABLED", @@ -99,7 +99,7 @@ func Test_internalProjectFeatureImpl_Set(t *testing.T) { name: "when the project key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -109,7 +109,7 @@ func Test_internalProjectFeatureImpl_Set(t *testing.T) { name: "when the project feature key is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", }, wantErr: true, @@ -120,7 +120,7 @@ func Test_internalProjectFeatureImpl_Set(t *testing.T) { name: "when the project feature state is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", featureKey: "jsw.classic.roadmap", }, @@ -132,7 +132,7 @@ func Test_internalProjectFeatureImpl_Set(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", featureKey: "jsw.classic.roadmap", state: "ENABLED", @@ -211,7 +211,7 @@ func Test_internalProjectFeatureImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", }, on: func(fields *fields) { @@ -240,7 +240,7 @@ func Test_internalProjectFeatureImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", }, on: func(fields *fields) { @@ -269,7 +269,7 @@ func Test_internalProjectFeatureImpl_Gets(t *testing.T) { name: "when the project key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -279,7 +279,7 @@ func Test_internalProjectFeatureImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", }, on: func(fields *fields) { diff --git a/jira/internal/project_impl_test.go b/jira/internal/project_impl_test.go index bf544310..9a2bdbea 100644 --- a/jira/internal/project_impl_test.go +++ b/jira/internal/project_impl_test.go @@ -52,7 +52,7 @@ func Test_internalProjectImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -81,7 +81,7 @@ func Test_internalProjectImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -110,7 +110,7 @@ func Test_internalProjectImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -201,7 +201,7 @@ func Test_internalProjectImpl_Search(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: mockedParams, startAt: 0, maxResults: 50, @@ -232,7 +232,7 @@ func Test_internalProjectImpl_Search(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: mockedParams, startAt: 0, maxResults: 50, @@ -263,7 +263,7 @@ func Test_internalProjectImpl_Search(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: mockedParams, startAt: 0, maxResults: 50, @@ -343,7 +343,7 @@ func Test_internalProjectImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", expand: []string{"issueTypes", "lead"}, }, @@ -373,7 +373,7 @@ func Test_internalProjectImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", expand: []string{"issueTypes", "lead"}, }, @@ -403,7 +403,7 @@ func Test_internalProjectImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", expand: []string{"issueTypes", "lead"}, }, @@ -496,7 +496,7 @@ func Test_internalProjectImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", payload: payloadMocked, }, @@ -526,7 +526,7 @@ func Test_internalProjectImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", payload: payloadMocked, }, @@ -556,7 +556,7 @@ func Test_internalProjectImpl_Update(t *testing.T) { name: "when the project key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -566,7 +566,7 @@ func Test_internalProjectImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", payload: payloadMocked, }, @@ -644,7 +644,7 @@ func Test_internalProjectImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", enableUndo: true, }, @@ -674,7 +674,7 @@ func Test_internalProjectImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", enableUndo: true, }, @@ -704,7 +704,7 @@ func Test_internalProjectImpl_Delete(t *testing.T) { name: "when the project key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -714,7 +714,7 @@ func Test_internalProjectImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", enableUndo: true, }, @@ -790,7 +790,7 @@ func Test_internalProjectImpl_DeleteAsynchronously(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", }, on: func(fields *fields) { @@ -819,7 +819,7 @@ func Test_internalProjectImpl_DeleteAsynchronously(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", }, on: func(fields *fields) { @@ -848,7 +848,7 @@ func Test_internalProjectImpl_DeleteAsynchronously(t *testing.T) { name: "when the project or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -858,7 +858,7 @@ func Test_internalProjectImpl_DeleteAsynchronously(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", }, on: func(fields *fields) { @@ -934,7 +934,7 @@ func Test_internalProjectImpl_Archive(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", }, on: func(fields *fields) { @@ -963,7 +963,7 @@ func Test_internalProjectImpl_Archive(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", }, on: func(fields *fields) { @@ -992,7 +992,7 @@ func Test_internalProjectImpl_Archive(t *testing.T) { name: "when the project key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -1002,7 +1002,7 @@ func Test_internalProjectImpl_Archive(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", }, on: func(fields *fields) { @@ -1077,7 +1077,7 @@ func Test_internalProjectImpl_Restore(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", }, on: func(fields *fields) { @@ -1106,7 +1106,7 @@ func Test_internalProjectImpl_Restore(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", }, on: func(fields *fields) { @@ -1135,7 +1135,7 @@ func Test_internalProjectImpl_Restore(t *testing.T) { name: "when the project or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -1145,7 +1145,7 @@ func Test_internalProjectImpl_Restore(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", }, on: func(fields *fields) { @@ -1221,7 +1221,7 @@ func Test_internalProjectImpl_Statuses(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", }, on: func(fields *fields) { @@ -1250,7 +1250,7 @@ func Test_internalProjectImpl_Statuses(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", }, on: func(fields *fields) { @@ -1279,7 +1279,7 @@ func Test_internalProjectImpl_Statuses(t *testing.T) { name: "when the project or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -1289,7 +1289,7 @@ func Test_internalProjectImpl_Statuses(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", }, on: func(fields *fields) { @@ -1366,7 +1366,7 @@ func Test_internalProjectImpl_NotificationScheme(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", expand: []string{"all", "projectRole"}, }, @@ -1396,7 +1396,7 @@ func Test_internalProjectImpl_NotificationScheme(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", expand: []string{"all", "projectRole"}, }, @@ -1426,7 +1426,7 @@ func Test_internalProjectImpl_NotificationScheme(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "KP", expand: []string{"all", "projectRole"}, }, diff --git a/jira/internal/project_permission_scheme_impl_test.go b/jira/internal/project_permission_scheme_impl_test.go index 8cbe816a..e78d517f 100644 --- a/jira/internal/project_permission_scheme_impl_test.go +++ b/jira/internal/project_permission_scheme_impl_test.go @@ -36,7 +36,7 @@ func Test_internalProjectPermissionSchemeImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", expand: []string{"field", "group"}, }, @@ -66,7 +66,7 @@ func Test_internalProjectPermissionSchemeImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", expand: []string{"field", "group"}, }, @@ -96,7 +96,7 @@ func Test_internalProjectPermissionSchemeImpl_Get(t *testing.T) { name: "when the project key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -106,7 +106,7 @@ func Test_internalProjectPermissionSchemeImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", expand: []string{"field", "group"}, }, @@ -183,7 +183,7 @@ func Test_internalProjectPermissionSchemeImpl_SecurityLevels(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", }, on: func(fields *fields) { @@ -212,7 +212,7 @@ func Test_internalProjectPermissionSchemeImpl_SecurityLevels(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", }, on: func(fields *fields) { @@ -241,7 +241,7 @@ func Test_internalProjectPermissionSchemeImpl_SecurityLevels(t *testing.T) { name: "when the project key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -251,7 +251,7 @@ func Test_internalProjectPermissionSchemeImpl_SecurityLevels(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", }, on: func(fields *fields) { @@ -330,7 +330,7 @@ func Test_internalProjectPermissionSchemeImpl_Assign(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", permissionSchemeId: 10001, }, @@ -360,7 +360,7 @@ func Test_internalProjectPermissionSchemeImpl_Assign(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", permissionSchemeId: 10001, }, @@ -390,7 +390,7 @@ func Test_internalProjectPermissionSchemeImpl_Assign(t *testing.T) { name: "when the project key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -400,7 +400,7 @@ func Test_internalProjectPermissionSchemeImpl_Assign(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", permissionSchemeId: 10001, }, diff --git a/jira/internal/project_property_impl_test.go b/jira/internal/project_property_impl_test.go index 63cd0d51..de207950 100644 --- a/jira/internal/project_property_impl_test.go +++ b/jira/internal/project_property_impl_test.go @@ -93,7 +93,7 @@ func Test_internalProjectPropertyImpl_Gets(t *testing.T) { name: "when the project key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, diff --git a/jira/internal/project_role_actor_impl_test.go b/jira/internal/project_role_actor_impl_test.go index 90ce34fa..a6654dc0 100644 --- a/jira/internal/project_role_actor_impl_test.go +++ b/jira/internal/project_role_actor_impl_test.go @@ -39,7 +39,7 @@ func Test_internalProjectRoleActorImpl_Add(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", roleId: 10001, accountIds: []string{"uuid"}, @@ -71,7 +71,7 @@ func Test_internalProjectRoleActorImpl_Add(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", roleId: 10001, accountIds: []string{"uuid"}, @@ -103,7 +103,7 @@ func Test_internalProjectRoleActorImpl_Add(t *testing.T) { name: "when the project key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -113,7 +113,7 @@ func Test_internalProjectRoleActorImpl_Add(t *testing.T) { name: "when the project role id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", }, wantErr: true, @@ -124,7 +124,7 @@ func Test_internalProjectRoleActorImpl_Add(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", roleId: 10001, accountIds: []string{"uuid"}, @@ -206,7 +206,7 @@ func Test_internalProjectRoleActorImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", roleId: 10001, accountId: "uuid", @@ -238,7 +238,7 @@ func Test_internalProjectRoleActorImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", roleId: 10001, accountId: "uuid", @@ -270,7 +270,7 @@ func Test_internalProjectRoleActorImpl_Delete(t *testing.T) { name: "when the project key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -280,7 +280,7 @@ func Test_internalProjectRoleActorImpl_Delete(t *testing.T) { name: "when the project role id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", }, wantErr: true, @@ -291,7 +291,7 @@ func Test_internalProjectRoleActorImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", roleId: 10001, accountId: "uuid", diff --git a/jira/internal/project_role_impl_test.go b/jira/internal/project_role_impl_test.go index 2b15c4e6..b8dd0ea0 100644 --- a/jira/internal/project_role_impl_test.go +++ b/jira/internal/project_role_impl_test.go @@ -38,7 +38,7 @@ func Test_internalProjectRoleImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", roleId: 10001, }, @@ -68,7 +68,7 @@ func Test_internalProjectRoleImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", roleId: 10001, }, @@ -98,7 +98,7 @@ func Test_internalProjectRoleImpl_Get(t *testing.T) { name: "when the project key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -108,7 +108,7 @@ func Test_internalProjectRoleImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", roleId: 10001, }, @@ -195,7 +195,7 @@ func Test_internalProjectRoleImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", }, on: func(fields *fields) { @@ -224,7 +224,7 @@ func Test_internalProjectRoleImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", }, on: func(fields *fields) { @@ -253,7 +253,7 @@ func Test_internalProjectRoleImpl_Gets(t *testing.T) { name: "when the project key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -263,7 +263,7 @@ func Test_internalProjectRoleImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", }, on: func(fields *fields) { @@ -287,7 +287,7 @@ func Test_internalProjectRoleImpl_Gets(t *testing.T) { name: "when the response empty is empty", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", }, on: func(fields *fields) { @@ -368,7 +368,7 @@ func Test_internalProjectRoleImpl_Details(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", }, on: func(fields *fields) { @@ -397,7 +397,7 @@ func Test_internalProjectRoleImpl_Details(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", }, on: func(fields *fields) { @@ -426,7 +426,7 @@ func Test_internalProjectRoleImpl_Details(t *testing.T) { name: "when the project key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -436,7 +436,7 @@ func Test_internalProjectRoleImpl_Details(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", }, on: func(fields *fields) { @@ -511,7 +511,7 @@ func Test_internalProjectRoleImpl_Global(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -539,7 +539,7 @@ func Test_internalProjectRoleImpl_Global(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -567,7 +567,7 @@ func Test_internalProjectRoleImpl_Global(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -647,7 +647,7 @@ func Test_internalProjectRoleImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -676,7 +676,7 @@ func Test_internalProjectRoleImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -705,7 +705,7 @@ func Test_internalProjectRoleImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { diff --git a/jira/internal/project_type_impl_test.go b/jira/internal/project_type_impl_test.go index fbdaea0a..3f0bb986 100644 --- a/jira/internal/project_type_impl_test.go +++ b/jira/internal/project_type_impl_test.go @@ -35,7 +35,7 @@ func Test_internalProjectTypeImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -63,7 +63,7 @@ func Test_internalProjectTypeImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -91,7 +91,7 @@ func Test_internalProjectTypeImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -165,7 +165,7 @@ func Test_internalProjectTypeImpl_Licensed(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -193,7 +193,7 @@ func Test_internalProjectTypeImpl_Licensed(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -221,7 +221,7 @@ func Test_internalProjectTypeImpl_Licensed(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -296,7 +296,7 @@ func Test_internalProjectTypeImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectTypeKey: "business", }, on: func(fields *fields) { @@ -325,7 +325,7 @@ func Test_internalProjectTypeImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectTypeKey: "business", }, on: func(fields *fields) { @@ -354,7 +354,7 @@ func Test_internalProjectTypeImpl_Get(t *testing.T) { name: "when the project type key is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectTypeKey: "", }, wantErr: true, @@ -365,7 +365,7 @@ func Test_internalProjectTypeImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectTypeKey: "business", }, on: func(fields *fields) { @@ -441,7 +441,7 @@ func Test_internalProjectTypeImpl_Accessible(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectTypeKey: "business", }, on: func(fields *fields) { @@ -470,7 +470,7 @@ func Test_internalProjectTypeImpl_Accessible(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectTypeKey: "business", }, on: func(fields *fields) { @@ -499,7 +499,7 @@ func Test_internalProjectTypeImpl_Accessible(t *testing.T) { name: "when the project type key is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectTypeKey: "", }, wantErr: true, @@ -510,7 +510,7 @@ func Test_internalProjectTypeImpl_Accessible(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectTypeKey: "business", }, on: func(fields *fields) { diff --git a/jira/internal/project_validator_impl_test.go b/jira/internal/project_validator_impl_test.go index e7965074..af09ed40 100644 --- a/jira/internal/project_validator_impl_test.go +++ b/jira/internal/project_validator_impl_test.go @@ -35,7 +35,7 @@ func Test_internalProjectValidatorImpl_Validate(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), key: "DUMMY", }, on: func(fields *fields) { @@ -64,7 +64,7 @@ func Test_internalProjectValidatorImpl_Validate(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), key: "DUMMY", }, on: func(fields *fields) { @@ -93,7 +93,7 @@ func Test_internalProjectValidatorImpl_Validate(t *testing.T) { name: "when the project key is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -103,7 +103,7 @@ func Test_internalProjectValidatorImpl_Validate(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), key: "DUMMY", }, on: func(fields *fields) { @@ -179,7 +179,7 @@ func Test_internalProjectValidatorImpl_Key(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), key: "DUMMY", }, on: func(fields *fields) { @@ -208,7 +208,7 @@ func Test_internalProjectValidatorImpl_Key(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), key: "DUMMY", }, on: func(fields *fields) { @@ -237,7 +237,7 @@ func Test_internalProjectValidatorImpl_Key(t *testing.T) { name: "when the project key is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -247,7 +247,7 @@ func Test_internalProjectValidatorImpl_Key(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), key: "DUMMY", }, on: func(fields *fields) { @@ -323,7 +323,7 @@ func Test_internalProjectValidatorImpl_Name(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), name: "DUMMY Project", }, on: func(fields *fields) { @@ -352,7 +352,7 @@ func Test_internalProjectValidatorImpl_Name(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), name: "DUMMY Project", }, on: func(fields *fields) { @@ -381,7 +381,7 @@ func Test_internalProjectValidatorImpl_Name(t *testing.T) { name: "when the project name is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectNameError, @@ -391,7 +391,7 @@ func Test_internalProjectValidatorImpl_Name(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), name: "DUMMY Project", }, on: func(fields *fields) { diff --git a/jira/internal/project_version_impl_test.go b/jira/internal/project_version_impl_test.go index 0d6d253f..1bcac978 100644 --- a/jira/internal/project_version_impl_test.go +++ b/jira/internal/project_version_impl_test.go @@ -36,7 +36,7 @@ func Test_internalProjectVersionImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", }, on: func(fields *fields) { @@ -65,7 +65,7 @@ func Test_internalProjectVersionImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", }, on: func(fields *fields) { @@ -94,7 +94,7 @@ func Test_internalProjectVersionImpl_Gets(t *testing.T) { name: "when the project key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -104,7 +104,7 @@ func Test_internalProjectVersionImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", }, on: func(fields *fields) { @@ -182,7 +182,7 @@ func Test_internalProjectVersionImpl_Search(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", options: &model.VersionGetsOptions{ OrderBy: "id", @@ -219,7 +219,7 @@ func Test_internalProjectVersionImpl_Search(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", options: &model.VersionGetsOptions{ OrderBy: "id", @@ -256,7 +256,7 @@ func Test_internalProjectVersionImpl_Search(t *testing.T) { name: "when the project key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectIDOrKeyError, @@ -266,7 +266,7 @@ func Test_internalProjectVersionImpl_Search(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeyOrId: "DUMMY", options: &model.VersionGetsOptions{ OrderBy: "id", @@ -352,7 +352,7 @@ func Test_internalProjectVersionImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), versionId: "10391", expand: []string{"operations"}, }, @@ -382,7 +382,7 @@ func Test_internalProjectVersionImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), versionId: "10391", expand: []string{"operations"}, }, @@ -412,7 +412,7 @@ func Test_internalProjectVersionImpl_Get(t *testing.T) { name: "when the project version is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoVersionIDError, @@ -422,7 +422,7 @@ func Test_internalProjectVersionImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), versionId: "10391", expand: []string{"operations"}, }, @@ -500,7 +500,7 @@ func Test_internalProjectVersionImpl_RelatedIssueCounts(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), versionId: "10391", }, on: func(fields *fields) { @@ -529,7 +529,7 @@ func Test_internalProjectVersionImpl_RelatedIssueCounts(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), versionId: "10391", }, on: func(fields *fields) { @@ -558,7 +558,7 @@ func Test_internalProjectVersionImpl_RelatedIssueCounts(t *testing.T) { name: "when the project version is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoVersionIDError, @@ -568,7 +568,7 @@ func Test_internalProjectVersionImpl_RelatedIssueCounts(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), versionId: "10391", }, on: func(fields *fields) { @@ -644,7 +644,7 @@ func Test_internalProjectVersionImpl_UnresolvedIssueCount(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), versionId: "10391", }, on: func(fields *fields) { @@ -673,7 +673,7 @@ func Test_internalProjectVersionImpl_UnresolvedIssueCount(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), versionId: "10391", }, on: func(fields *fields) { @@ -702,7 +702,7 @@ func Test_internalProjectVersionImpl_UnresolvedIssueCount(t *testing.T) { name: "when the project version is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoVersionIDError, @@ -712,7 +712,7 @@ func Test_internalProjectVersionImpl_UnresolvedIssueCount(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), versionId: "10391", }, on: func(fields *fields) { @@ -788,7 +788,7 @@ func Test_internalProjectVersionImpl_Merge(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), versionId: "10391", versionMoveIssuesTo: "10392", }, @@ -818,7 +818,7 @@ func Test_internalProjectVersionImpl_Merge(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), versionId: "10391", versionMoveIssuesTo: "10392", }, @@ -848,7 +848,7 @@ func Test_internalProjectVersionImpl_Merge(t *testing.T) { name: "when the source project version is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoVersionIDError, @@ -858,7 +858,7 @@ func Test_internalProjectVersionImpl_Merge(t *testing.T) { name: "when the destination project version is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), versionId: "100392", }, wantErr: true, @@ -869,7 +869,7 @@ func Test_internalProjectVersionImpl_Merge(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), versionId: "10391", versionMoveIssuesTo: "10392", }, @@ -955,7 +955,7 @@ func Test_internalProjectVersionImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -984,7 +984,7 @@ func Test_internalProjectVersionImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -1013,7 +1013,7 @@ func Test_internalProjectVersionImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -1100,7 +1100,7 @@ func Test_internalProjectVersionImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), versionId: "10923", payload: payloadMocked, }, @@ -1130,7 +1130,7 @@ func Test_internalProjectVersionImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), versionId: "10923", payload: payloadMocked, }, @@ -1160,7 +1160,7 @@ func Test_internalProjectVersionImpl_Update(t *testing.T) { name: "when the version id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoVersionIDError, @@ -1170,7 +1170,7 @@ func Test_internalProjectVersionImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), versionId: "10923", payload: payloadMocked, }, diff --git a/jira/internal/resolution_impl_test.go b/jira/internal/resolution_impl_test.go index 6c48fddc..a6f921b0 100644 --- a/jira/internal/resolution_impl_test.go +++ b/jira/internal/resolution_impl_test.go @@ -35,7 +35,7 @@ func Test_internalResolutionImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -63,7 +63,7 @@ func Test_internalResolutionImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -91,7 +91,7 @@ func Test_internalResolutionImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -166,7 +166,7 @@ func Test_internalResolutionImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), resolutionId: "2", }, on: func(fields *fields) { @@ -195,7 +195,7 @@ func Test_internalResolutionImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), resolutionId: "2", }, on: func(fields *fields) { @@ -224,7 +224,7 @@ func Test_internalResolutionImpl_Get(t *testing.T) { name: "when the resolution id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoResolutionIDError, @@ -234,7 +234,7 @@ func Test_internalResolutionImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), resolutionId: "2", }, on: func(fields *fields) { diff --git a/jira/internal/screen_impl_test.go b/jira/internal/screen_impl_test.go index 5bc9f544..046cf7a3 100644 --- a/jira/internal/screen_impl_test.go +++ b/jira/internal/screen_impl_test.go @@ -37,7 +37,7 @@ func Test_internalScreenImpl_Fields(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "customfield_12000", startAt: 100, maxResults: 50, @@ -68,7 +68,7 @@ func Test_internalScreenImpl_Fields(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "customfield_12000", startAt: 100, maxResults: 50, @@ -99,7 +99,7 @@ func Test_internalScreenImpl_Fields(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoFieldIDError, @@ -109,7 +109,7 @@ func Test_internalScreenImpl_Fields(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "customfield_12000", startAt: 100, maxResults: 50, @@ -189,7 +189,7 @@ func Test_internalScreenImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.ScreenParamsScheme{ IDs: []int{10002, 10002}, QueryString: "Default DUMMY Screen", @@ -225,7 +225,7 @@ func Test_internalScreenImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.ScreenParamsScheme{ IDs: []int{10002, 10002}, QueryString: "Default DUMMY Screen", @@ -261,7 +261,7 @@ func Test_internalScreenImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.ScreenParamsScheme{ IDs: []int{10002, 10002}, QueryString: "Default DUMMY Screen", @@ -345,7 +345,7 @@ func Test_internalScreenImpl_AddToDefault(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "customfield_12700", }, on: func(fields *fields) { @@ -374,7 +374,7 @@ func Test_internalScreenImpl_AddToDefault(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "customfield_12700", }, on: func(fields *fields) { @@ -403,7 +403,7 @@ func Test_internalScreenImpl_AddToDefault(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoFieldIDError, @@ -413,7 +413,7 @@ func Test_internalScreenImpl_AddToDefault(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), fieldId: "customfield_12700", }, on: func(fields *fields) { @@ -488,7 +488,7 @@ func Test_internalScreenImpl_Available(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10001, }, on: func(fields *fields) { @@ -517,7 +517,7 @@ func Test_internalScreenImpl_Available(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10001, }, on: func(fields *fields) { @@ -546,7 +546,7 @@ func Test_internalScreenImpl_Available(t *testing.T) { name: "when the screen id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoScreenIDError, @@ -556,7 +556,7 @@ func Test_internalScreenImpl_Available(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10001, }, on: func(fields *fields) { @@ -634,7 +634,7 @@ func Test_internalScreenImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), name: "Screen Name", description: "Screen Description", }, @@ -664,7 +664,7 @@ func Test_internalScreenImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), name: "Screen Name", description: "Screen Description", }, @@ -694,7 +694,7 @@ func Test_internalScreenImpl_Create(t *testing.T) { name: "when the screen name is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoScreenNameError, @@ -704,7 +704,7 @@ func Test_internalScreenImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), name: "Screen Name", description: "Screen Description", }, @@ -784,7 +784,7 @@ func Test_internalScreenImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10001, name: "Screen Name", description: "Screen Description", @@ -815,7 +815,7 @@ func Test_internalScreenImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10001, name: "Screen Name", description: "Screen Description", @@ -846,7 +846,7 @@ func Test_internalScreenImpl_Update(t *testing.T) { name: "when the screen id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoScreenIDError, @@ -856,7 +856,7 @@ func Test_internalScreenImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10001, name: "Screen Name", description: "Screen Description", @@ -935,7 +935,7 @@ func Test_internalScreenImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10001, }, on: func(fields *fields) { @@ -964,7 +964,7 @@ func Test_internalScreenImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10001, }, on: func(fields *fields) { @@ -993,7 +993,7 @@ func Test_internalScreenImpl_Delete(t *testing.T) { name: "when the screen id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoScreenIDError, @@ -1003,7 +1003,7 @@ func Test_internalScreenImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10001, }, on: func(fields *fields) { diff --git a/jira/internal/screen_scheme_impl_test.go b/jira/internal/screen_scheme_impl_test.go index 597c4ed3..22eaaf52 100644 --- a/jira/internal/screen_scheme_impl_test.go +++ b/jira/internal/screen_scheme_impl_test.go @@ -36,7 +36,7 @@ func Test_internalScreenSchemeImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.ScreenSchemeParamsScheme{ IDs: []int{1292, 38403}, QueryString: "DUMMY Screen", @@ -72,7 +72,7 @@ func Test_internalScreenSchemeImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.ScreenSchemeParamsScheme{ IDs: []int{1292, 38403}, QueryString: "DUMMY Screen", @@ -108,7 +108,7 @@ func Test_internalScreenSchemeImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.ScreenSchemeParamsScheme{ IDs: []int{1292, 38403}, QueryString: "DUMMY Screen", @@ -202,7 +202,7 @@ func Test_internalScreenSchemeImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -231,7 +231,7 @@ func Test_internalScreenSchemeImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -260,7 +260,7 @@ func Test_internalScreenSchemeImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -347,7 +347,7 @@ func Test_internalScreenSchemeImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenSchemeId: "10001", payload: payloadMocked, }, @@ -377,7 +377,7 @@ func Test_internalScreenSchemeImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenSchemeId: "10001", payload: payloadMocked, }, @@ -407,7 +407,7 @@ func Test_internalScreenSchemeImpl_Update(t *testing.T) { name: "when the screen scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoScreenSchemeIDError, @@ -417,7 +417,7 @@ func Test_internalScreenSchemeImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenSchemeId: "10001", payload: payloadMocked, }, @@ -493,7 +493,7 @@ func Test_internalScreenSchemeImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenSchemeId: "10001", }, on: func(fields *fields) { @@ -522,7 +522,7 @@ func Test_internalScreenSchemeImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenSchemeId: "10001", }, on: func(fields *fields) { @@ -551,7 +551,7 @@ func Test_internalScreenSchemeImpl_Delete(t *testing.T) { name: "when the screen scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoScreenSchemeIDError, @@ -561,7 +561,7 @@ func Test_internalScreenSchemeImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenSchemeId: "10001", }, on: func(fields *fields) { diff --git a/jira/internal/screen_tab_field_impl_test.go b/jira/internal/screen_tab_field_impl_test.go index a7ba6f07..7a866c65 100644 --- a/jira/internal/screen_tab_field_impl_test.go +++ b/jira/internal/screen_tab_field_impl_test.go @@ -36,7 +36,7 @@ func Test_internalScreenTabFieldImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 18272, }, @@ -66,7 +66,7 @@ func Test_internalScreenTabFieldImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 18272, }, @@ -96,7 +96,7 @@ func Test_internalScreenTabFieldImpl_Gets(t *testing.T) { name: "when the screen id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoScreenIDError, @@ -106,7 +106,7 @@ func Test_internalScreenTabFieldImpl_Gets(t *testing.T) { name: "when the tab id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10001, }, wantErr: true, @@ -117,7 +117,7 @@ func Test_internalScreenTabFieldImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 18272, }, @@ -197,7 +197,7 @@ func Test_internalScreenTabFieldImpl_Add(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 18272, fieldId: "customfield_10001", @@ -228,7 +228,7 @@ func Test_internalScreenTabFieldImpl_Add(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 18272, fieldId: "customfield_10001", @@ -259,7 +259,7 @@ func Test_internalScreenTabFieldImpl_Add(t *testing.T) { name: "when the screen id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoScreenIDError, @@ -269,7 +269,7 @@ func Test_internalScreenTabFieldImpl_Add(t *testing.T) { name: "when the tab id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10001, }, wantErr: true, @@ -280,7 +280,7 @@ func Test_internalScreenTabFieldImpl_Add(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10001, tabId: 10001, }, @@ -292,7 +292,7 @@ func Test_internalScreenTabFieldImpl_Add(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 18272, fieldId: "customfield_10001", @@ -372,7 +372,7 @@ func Test_internalScreenTabFieldImpl_Remove(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 18272, fieldId: "customfield_10001", @@ -403,7 +403,7 @@ func Test_internalScreenTabFieldImpl_Remove(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 18272, fieldId: "customfield_10001", @@ -434,7 +434,7 @@ func Test_internalScreenTabFieldImpl_Remove(t *testing.T) { name: "when the screen id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoScreenIDError, @@ -444,7 +444,7 @@ func Test_internalScreenTabFieldImpl_Remove(t *testing.T) { name: "when the tab id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10001, }, wantErr: true, @@ -455,7 +455,7 @@ func Test_internalScreenTabFieldImpl_Remove(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10001, tabId: 10001, }, @@ -467,7 +467,7 @@ func Test_internalScreenTabFieldImpl_Remove(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 18272, fieldId: "customfield_10001", @@ -549,7 +549,7 @@ func Test_internalScreenTabFieldImpl_Move(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 18272, fieldId: "customfield_10001", @@ -581,7 +581,7 @@ func Test_internalScreenTabFieldImpl_Move(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 18272, fieldId: "customfield_10001", @@ -613,7 +613,7 @@ func Test_internalScreenTabFieldImpl_Move(t *testing.T) { name: "when the screen id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoScreenIDError, @@ -623,7 +623,7 @@ func Test_internalScreenTabFieldImpl_Move(t *testing.T) { name: "when the tab id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10001, }, wantErr: true, @@ -634,7 +634,7 @@ func Test_internalScreenTabFieldImpl_Move(t *testing.T) { name: "when the field id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10001, tabId: 10001, }, @@ -646,7 +646,7 @@ func Test_internalScreenTabFieldImpl_Move(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 18272, fieldId: "customfield_10001", diff --git a/jira/internal/screen_tab_impl_test.go b/jira/internal/screen_tab_impl_test.go index 4f558b2b..cae5e952 100644 --- a/jira/internal/screen_tab_impl_test.go +++ b/jira/internal/screen_tab_impl_test.go @@ -37,7 +37,7 @@ func Test_internalScreenTabImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, projectKey: "DUMMY", }, @@ -67,7 +67,7 @@ func Test_internalScreenTabImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, projectKey: "DUMMY", }, @@ -97,7 +97,7 @@ func Test_internalScreenTabImpl_Gets(t *testing.T) { name: "when the screen id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoScreenIDError, @@ -107,7 +107,7 @@ func Test_internalScreenTabImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, projectKey: "DUMMY", }, @@ -187,7 +187,7 @@ func Test_internalScreenTabImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabName: "Time Tracking", }, @@ -217,7 +217,7 @@ func Test_internalScreenTabImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabName: "Time Tracking", }, @@ -247,7 +247,7 @@ func Test_internalScreenTabImpl_Create(t *testing.T) { name: "when the screen id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoScreenIDError, @@ -257,7 +257,7 @@ func Test_internalScreenTabImpl_Create(t *testing.T) { name: "when the tab name is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 19392, }, wantErr: true, @@ -268,7 +268,7 @@ func Test_internalScreenTabImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabName: "Time Tracking", }, @@ -349,7 +349,7 @@ func Test_internalScreenTabImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 10001, newTabName: "Time Tracking", @@ -380,7 +380,7 @@ func Test_internalScreenTabImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 10001, newTabName: "Time Tracking", @@ -411,7 +411,7 @@ func Test_internalScreenTabImpl_Update(t *testing.T) { name: "when the screen id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoScreenIDError, @@ -421,7 +421,7 @@ func Test_internalScreenTabImpl_Update(t *testing.T) { name: "when the tab id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 19392, }, wantErr: true, @@ -432,7 +432,7 @@ func Test_internalScreenTabImpl_Update(t *testing.T) { name: "when the tab name is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 19392, tabId: 10001, }, @@ -444,7 +444,7 @@ func Test_internalScreenTabImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 10001, newTabName: "Time Tracking", @@ -524,7 +524,7 @@ func Test_internalScreenTabImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 10001, }, @@ -554,7 +554,7 @@ func Test_internalScreenTabImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 10001, }, @@ -584,7 +584,7 @@ func Test_internalScreenTabImpl_Delete(t *testing.T) { name: "when the screen id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoScreenIDError, @@ -594,7 +594,7 @@ func Test_internalScreenTabImpl_Delete(t *testing.T) { name: "when the tab id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 19392, }, wantErr: true, @@ -605,7 +605,7 @@ func Test_internalScreenTabImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 10001, }, @@ -683,7 +683,7 @@ func Test_internalScreenTabImpl_Move(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 10001, position: 1, @@ -714,7 +714,7 @@ func Test_internalScreenTabImpl_Move(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 10001, position: 1, @@ -745,7 +745,7 @@ func Test_internalScreenTabImpl_Move(t *testing.T) { name: "when the screen id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoScreenIDError, @@ -755,7 +755,7 @@ func Test_internalScreenTabImpl_Move(t *testing.T) { name: "when the tab id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 19392, }, wantErr: true, @@ -766,7 +766,7 @@ func Test_internalScreenTabImpl_Move(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), screenId: 10002, tabId: 10001, position: 1, diff --git a/jira/internal/search_impl_adf_test.go b/jira/internal/search_impl_adf_test.go index a5c0227a..6ae0427b 100644 --- a/jira/internal/search_impl_adf_test.go +++ b/jira/internal/search_impl_adf_test.go @@ -44,7 +44,7 @@ func Test_internalSearchADFImpl_Checks(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -73,7 +73,7 @@ func Test_internalSearchADFImpl_Checks(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -102,7 +102,7 @@ func Test_internalSearchADFImpl_Checks(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -190,7 +190,7 @@ func Test_internalSearchADFImpl_Post(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), jql: "project = FOO", fields: []string{"status", "summary"}, expands: []string{"operations"}, @@ -224,7 +224,7 @@ func Test_internalSearchADFImpl_Post(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), jql: "project = FOO", fields: []string{"status", "summary"}, expands: []string{"operations"}, @@ -258,7 +258,7 @@ func Test_internalSearchADFImpl_Post(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), jql: "project = FOO", fields: []string{"status", "summary"}, expands: []string{"operations"}, @@ -343,7 +343,7 @@ func Test_internalSearchADFImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), jql: "project = FOO", fields: []string{"status", "summary"}, expands: []string{"operations"}, @@ -377,7 +377,7 @@ func Test_internalSearchADFImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), jql: "project = FOO", fields: []string{"status", "summary"}, expands: []string{"operations"}, @@ -411,7 +411,7 @@ func Test_internalSearchADFImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), jql: "project = FOO", fields: []string{"status", "summary"}, expands: []string{"operations"}, diff --git a/jira/internal/search_impl_rich_text_test.go b/jira/internal/search_impl_rich_text_test.go index 60c7147a..3336b2ff 100644 --- a/jira/internal/search_impl_rich_text_test.go +++ b/jira/internal/search_impl_rich_text_test.go @@ -44,7 +44,7 @@ func Test_internalSearchRichTextImpl_Checks(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -73,7 +73,7 @@ func Test_internalSearchRichTextImpl_Checks(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -102,7 +102,7 @@ func Test_internalSearchRichTextImpl_Checks(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -190,7 +190,7 @@ func Test_internalSearchRichTextImpl_Post(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), jql: "project = FOO", fields: []string{"status", "summary"}, expands: []string{"operations"}, @@ -224,7 +224,7 @@ func Test_internalSearchRichTextImpl_Post(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), jql: "project = FOO", fields: []string{"status", "summary"}, expands: []string{"operations"}, @@ -258,7 +258,7 @@ func Test_internalSearchRichTextImpl_Post(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), jql: "project = FOO", fields: []string{"status", "summary"}, expands: []string{"operations"}, @@ -343,7 +343,7 @@ func Test_internalSearchRichTextImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), jql: "project = FOO", fields: []string{"status", "summary"}, expands: []string{"operations"}, @@ -377,7 +377,7 @@ func Test_internalSearchRichTextImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), jql: "project = FOO", fields: []string{"status", "summary"}, expands: []string{"operations"}, @@ -411,7 +411,7 @@ func Test_internalSearchRichTextImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), jql: "project = FOO", fields: []string{"status", "summary"}, expands: []string{"operations"}, diff --git a/jira/internal/server_impl_test.go b/jira/internal/server_impl_test.go index 369d8d54..38347017 100644 --- a/jira/internal/server_impl_test.go +++ b/jira/internal/server_impl_test.go @@ -34,7 +34,7 @@ func Test_internalServerServiceImpl_Info(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -62,7 +62,7 @@ func Test_internalServerServiceImpl_Info(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -90,7 +90,7 @@ func Test_internalServerServiceImpl_Info(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { diff --git a/jira/internal/task_impl_test.go b/jira/internal/task_impl_test.go index 6fa6ebec..b4379f5f 100644 --- a/jira/internal/task_impl_test.go +++ b/jira/internal/task_impl_test.go @@ -35,7 +35,7 @@ func Test_internalTaskServiceImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), taskId: "uuid-sample", }, on: func(fields *fields) { @@ -64,7 +64,7 @@ func Test_internalTaskServiceImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), taskId: "uuid-sample", }, on: func(fields *fields) { @@ -93,7 +93,7 @@ func Test_internalTaskServiceImpl_Get(t *testing.T) { name: "when the task id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoTaskIDError, @@ -103,7 +103,7 @@ func Test_internalTaskServiceImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), taskId: "uuid-sample", }, on: func(fields *fields) { @@ -179,7 +179,7 @@ func Test_internalTaskServiceImpl_Cancel(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), taskId: "uuid-sample", }, on: func(fields *fields) { @@ -208,7 +208,7 @@ func Test_internalTaskServiceImpl_Cancel(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), taskId: "uuid-sample", }, on: func(fields *fields) { @@ -237,7 +237,7 @@ func Test_internalTaskServiceImpl_Cancel(t *testing.T) { name: "when the task id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoTaskIDError, @@ -247,7 +247,7 @@ func Test_internalTaskServiceImpl_Cancel(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), taskId: "uuid-sample", }, on: func(fields *fields) { diff --git a/jira/internal/team_impl_test.go b/jira/internal/team_impl_test.go index 557513b2..ebcbffcf 100644 --- a/jira/internal/team_impl_test.go +++ b/jira/internal/team_impl_test.go @@ -35,7 +35,7 @@ func Test_internalTeamServiceImpl_Gets(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), maxResults: 1000, }, on: func(fields *fields) { @@ -63,7 +63,7 @@ func Test_internalTeamServiceImpl_Gets(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), maxResults: 1000, }, on: func(fields *fields) { @@ -86,7 +86,7 @@ func Test_internalTeamServiceImpl_Gets(t *testing.T) { { name: "when the http call returns an error", args: args{ - ctx: context.TODO(), + ctx: context.Background(), maxResults: 1000, }, on: func(fields *fields) { @@ -173,7 +173,7 @@ func Test_internalTeamServiceImpl_Create(t *testing.T) { { name: "when the parameters are correct", args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -201,7 +201,7 @@ func Test_internalTeamServiceImpl_Create(t *testing.T) { { name: "when the http request cannot be created", args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -224,7 +224,7 @@ func Test_internalTeamServiceImpl_Create(t *testing.T) { { name: "when the http call cannot be executed", args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { diff --git a/jira/internal/type_impl_test.go b/jira/internal/type_impl_test.go index 3ed4ed7a..7536be45 100644 --- a/jira/internal/type_impl_test.go +++ b/jira/internal/type_impl_test.go @@ -35,7 +35,7 @@ func Test_internalTypeImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -63,7 +63,7 @@ func Test_internalTypeImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -91,7 +91,7 @@ func Test_internalTypeImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -166,7 +166,7 @@ func Test_internalTypeImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeId: "8", }, on: func(fields *fields) { @@ -195,7 +195,7 @@ func Test_internalTypeImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeId: "8", }, on: func(fields *fields) { @@ -224,7 +224,7 @@ func Test_internalTypeImpl_Get(t *testing.T) { name: "when the issue type id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoIssueTypeIDError, @@ -234,7 +234,7 @@ func Test_internalTypeImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeId: "8", }, on: func(fields *fields) { @@ -310,7 +310,7 @@ func Test_internalTypeImpl_Alternatives(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeId: "8", }, on: func(fields *fields) { @@ -339,7 +339,7 @@ func Test_internalTypeImpl_Alternatives(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeId: "8", }, on: func(fields *fields) { @@ -368,7 +368,7 @@ func Test_internalTypeImpl_Alternatives(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeId: "8", }, on: func(fields *fields) { @@ -450,7 +450,7 @@ func Test_internalTypeImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -479,7 +479,7 @@ func Test_internalTypeImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -508,7 +508,7 @@ func Test_internalTypeImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -591,7 +591,7 @@ func Test_internalTypeImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeId: "8", payload: payloadMocked, }, @@ -621,7 +621,7 @@ func Test_internalTypeImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeId: "8", payload: payloadMocked, }, @@ -651,7 +651,7 @@ func Test_internalTypeImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeId: "8", payload: payloadMocked, }, @@ -728,7 +728,7 @@ func Test_internalTypeImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeId: "8", }, on: func(fields *fields) { @@ -757,7 +757,7 @@ func Test_internalTypeImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeId: "8", }, on: func(fields *fields) { @@ -786,7 +786,7 @@ func Test_internalTypeImpl_Delete(t *testing.T) { name: "when the issue type id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoIssueTypeIDError, @@ -796,7 +796,7 @@ func Test_internalTypeImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeId: "8", }, on: func(fields *fields) { diff --git a/jira/internal/type_scheme_impl_test.go b/jira/internal/type_scheme_impl_test.go index b6a14dd0..70541ca0 100644 --- a/jira/internal/type_scheme_impl_test.go +++ b/jira/internal/type_scheme_impl_test.go @@ -36,7 +36,7 @@ func Test_internalTypeSchemeImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeSchemeIds: []int{1001, 1002}, startAt: 50, maxResults: 100, @@ -67,7 +67,7 @@ func Test_internalTypeSchemeImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeSchemeIds: []int{1001, 1002}, startAt: 50, maxResults: 100, @@ -98,7 +98,7 @@ func Test_internalTypeSchemeImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeSchemeIds: []int{1001, 1002}, startAt: 50, maxResults: 100, @@ -178,7 +178,7 @@ func Test_internalTypeSchemeImpl_Items(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeSchemeIds: []int{1001, 1002}, startAt: 50, maxResults: 100, @@ -209,7 +209,7 @@ func Test_internalTypeSchemeImpl_Items(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeSchemeIds: []int{1001, 1002}, startAt: 50, maxResults: 100, @@ -240,7 +240,7 @@ func Test_internalTypeSchemeImpl_Items(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeSchemeIds: []int{1001, 1002}, startAt: 50, maxResults: 100, @@ -320,7 +320,7 @@ func Test_internalTypeSchemeImpl_Projects(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectIds: []int{1001, 1002}, startAt: 50, maxResults: 100, @@ -351,7 +351,7 @@ func Test_internalTypeSchemeImpl_Projects(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectIds: []int{1001, 1002}, startAt: 50, maxResults: 100, @@ -382,7 +382,7 @@ func Test_internalTypeSchemeImpl_Projects(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectIds: []int{1001, 1002}, startAt: 50, maxResults: 100, @@ -468,7 +468,7 @@ func Test_internalTypeSchemeImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -497,7 +497,7 @@ func Test_internalTypeSchemeImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -526,7 +526,7 @@ func Test_internalTypeSchemeImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -610,7 +610,7 @@ func Test_internalTypeSchemeImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeSchemeId: 10001, payload: payloadMocked, }, @@ -640,7 +640,7 @@ func Test_internalTypeSchemeImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeSchemeId: 10001, payload: payloadMocked, }, @@ -670,7 +670,7 @@ func Test_internalTypeSchemeImpl_Update(t *testing.T) { name: "when the issue type scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, wantErr: true, @@ -681,7 +681,7 @@ func Test_internalTypeSchemeImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeSchemeId: 10001, payload: payloadMocked, }, @@ -761,7 +761,7 @@ func Test_internalTypeSchemeImpl_Append(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeSchemeId: 10001, issueTypeIds: []int{8, 10, 2}, }, @@ -791,7 +791,7 @@ func Test_internalTypeSchemeImpl_Append(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeSchemeId: 10001, issueTypeIds: []int{8, 10, 2}, }, @@ -821,7 +821,7 @@ func Test_internalTypeSchemeImpl_Append(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeSchemeId: 10001, issueTypeIds: []int{8, 10, 2}, }, @@ -898,7 +898,7 @@ func Test_internalTypeSchemeImpl_Remove(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeId: 9, issueTypeSchemeId: 10001, }, @@ -928,7 +928,7 @@ func Test_internalTypeSchemeImpl_Remove(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeId: 9, issueTypeSchemeId: 10001, }, @@ -958,7 +958,7 @@ func Test_internalTypeSchemeImpl_Remove(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeId: 9, issueTypeSchemeId: 10001, }, @@ -1034,7 +1034,7 @@ func Test_internalTypeSchemeImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeSchemeId: 10001, }, on: func(fields *fields) { @@ -1063,7 +1063,7 @@ func Test_internalTypeSchemeImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeSchemeId: 10001, }, on: func(fields *fields) { @@ -1092,7 +1092,7 @@ func Test_internalTypeSchemeImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeSchemeId: 10001, }, on: func(fields *fields) { @@ -1169,7 +1169,7 @@ func Test_internalTypeSchemeImpl_Assign(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectId: "9", issueTypeSchemeId: "10001", }, @@ -1199,7 +1199,7 @@ func Test_internalTypeSchemeImpl_Assign(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectId: "9", issueTypeSchemeId: "10001", }, @@ -1229,7 +1229,7 @@ func Test_internalTypeSchemeImpl_Assign(t *testing.T) { name: "when the project id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeSchemeId: "10001", }, wantErr: true, @@ -1240,7 +1240,7 @@ func Test_internalTypeSchemeImpl_Assign(t *testing.T) { name: "when the issue type scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectId: "9", }, wantErr: true, @@ -1251,7 +1251,7 @@ func Test_internalTypeSchemeImpl_Assign(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectId: "9", issueTypeSchemeId: "10001", }, diff --git a/jira/internal/type_screen_scheme_impl_test.go b/jira/internal/type_screen_scheme_impl_test.go index a86e5b2b..44a9b3fb 100644 --- a/jira/internal/type_screen_scheme_impl_test.go +++ b/jira/internal/type_screen_scheme_impl_test.go @@ -36,7 +36,7 @@ func Test_internalTypeScreenSchemeImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.ScreenSchemeParamsScheme{ IDs: []int{10001, 10002}, QueryString: "query", @@ -72,7 +72,7 @@ func Test_internalTypeScreenSchemeImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.ScreenSchemeParamsScheme{ IDs: []int{10001, 10002}, QueryString: "query", @@ -108,7 +108,7 @@ func Test_internalTypeScreenSchemeImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.ScreenSchemeParamsScheme{ IDs: []int{10001, 10002}, QueryString: "query", @@ -193,7 +193,7 @@ func Test_internalTypeScreenSchemeImpl_Projects(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectIds: []int{29992, 349383}, startAt: 50, maxResults: 100, @@ -224,7 +224,7 @@ func Test_internalTypeScreenSchemeImpl_Projects(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectIds: []int{29992, 349383}, startAt: 50, maxResults: 100, @@ -255,7 +255,7 @@ func Test_internalTypeScreenSchemeImpl_Projects(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectIds: []int{29992, 349383}, startAt: 50, maxResults: 100, @@ -335,7 +335,7 @@ func Test_internalTypeScreenSchemeImpl_Mapping(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeIds: []int{29992, 349383}, startAt: 50, maxResults: 100, @@ -366,7 +366,7 @@ func Test_internalTypeScreenSchemeImpl_Mapping(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeIds: []int{29992, 349383}, startAt: 50, maxResults: 100, @@ -397,7 +397,7 @@ func Test_internalTypeScreenSchemeImpl_Mapping(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeIds: []int{29992, 349383}, startAt: 50, maxResults: 100, @@ -477,7 +477,7 @@ func Test_internalTypeScreenSchemeImpl_SchemesByProject(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: 29992, startAt: 50, maxResults: 100, @@ -508,7 +508,7 @@ func Test_internalTypeScreenSchemeImpl_SchemesByProject(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: 29992, startAt: 50, maxResults: 100, @@ -539,7 +539,7 @@ func Test_internalTypeScreenSchemeImpl_SchemesByProject(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: 29992, startAt: 50, maxResults: 100, @@ -620,7 +620,7 @@ func Test_internalTypeScreenSchemeImpl_Assign(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", projectId: "848483", }, @@ -650,7 +650,7 @@ func Test_internalTypeScreenSchemeImpl_Assign(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", projectId: "848483", }, @@ -680,7 +680,7 @@ func Test_internalTypeScreenSchemeImpl_Assign(t *testing.T) { name: "when the issue type screen scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "", }, wantErr: true, @@ -691,7 +691,7 @@ func Test_internalTypeScreenSchemeImpl_Assign(t *testing.T) { name: "when the project id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", }, wantErr: true, @@ -702,7 +702,7 @@ func Test_internalTypeScreenSchemeImpl_Assign(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", projectId: "848483", }, @@ -780,7 +780,7 @@ func Test_internalTypeScreenSchemeImpl_Update(t *testing.T) { name: "when the issue type screen scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "", }, wantErr: true, @@ -790,7 +790,7 @@ func Test_internalTypeScreenSchemeImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", name: "New issue type scheme name", description: "New issue type scheme description", @@ -821,7 +821,7 @@ func Test_internalTypeScreenSchemeImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", name: "New issue type scheme name", description: "New issue type scheme description", @@ -852,7 +852,7 @@ func Test_internalTypeScreenSchemeImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", name: "New issue type scheme name", description: "New issue type scheme description", @@ -930,7 +930,7 @@ func Test_internalTypeScreenSchemeImpl_Delete(t *testing.T) { name: "when the issue type screen scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "", }, wantErr: true, @@ -940,7 +940,7 @@ func Test_internalTypeScreenSchemeImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", }, on: func(fields *fields) { @@ -969,7 +969,7 @@ func Test_internalTypeScreenSchemeImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", }, on: func(fields *fields) { @@ -998,7 +998,7 @@ func Test_internalTypeScreenSchemeImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", }, on: func(fields *fields) { @@ -1087,7 +1087,7 @@ func Test_internalTypeScreenSchemeImpl_Append(t *testing.T) { name: "when the issue type screen scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "", }, wantErr: true, @@ -1097,7 +1097,7 @@ func Test_internalTypeScreenSchemeImpl_Append(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", payload: payloadMocked, }, @@ -1127,7 +1127,7 @@ func Test_internalTypeScreenSchemeImpl_Append(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", payload: payloadMocked, }, @@ -1157,7 +1157,7 @@ func Test_internalTypeScreenSchemeImpl_Append(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", payload: payloadMocked, }, @@ -1236,7 +1236,7 @@ func Test_internalTypeScreenSchemeImpl_UpdateDefault(t *testing.T) { name: "when the issue type screen scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "", }, wantErr: true, @@ -1246,7 +1246,7 @@ func Test_internalTypeScreenSchemeImpl_UpdateDefault(t *testing.T) { name: "when the screen scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", }, wantErr: true, @@ -1256,7 +1256,7 @@ func Test_internalTypeScreenSchemeImpl_UpdateDefault(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", screenSchemeId: "200202", }, @@ -1286,7 +1286,7 @@ func Test_internalTypeScreenSchemeImpl_UpdateDefault(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", screenSchemeId: "200202", }, @@ -1316,7 +1316,7 @@ func Test_internalTypeScreenSchemeImpl_UpdateDefault(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", screenSchemeId: "200202", }, @@ -1396,7 +1396,7 @@ func Test_internalTypeScreenSchemeImpl_Remove(t *testing.T) { name: "when the issue type screen scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "", }, wantErr: true, @@ -1406,7 +1406,7 @@ func Test_internalTypeScreenSchemeImpl_Remove(t *testing.T) { name: "when the issue type id's are not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "2201", }, wantErr: true, @@ -1416,7 +1416,7 @@ func Test_internalTypeScreenSchemeImpl_Remove(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", issueTypeIds: []string{"9", "43"}, }, @@ -1446,7 +1446,7 @@ func Test_internalTypeScreenSchemeImpl_Remove(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", issueTypeIds: []string{"9", "43"}, }, @@ -1476,7 +1476,7 @@ func Test_internalTypeScreenSchemeImpl_Remove(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueTypeScreenSchemeId: "20001", issueTypeIds: []string{"9", "43"}, }, @@ -1567,7 +1567,7 @@ func Test_internalTypeScreenSchemeImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -1596,7 +1596,7 @@ func Test_internalTypeScreenSchemeImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -1625,7 +1625,7 @@ func Test_internalTypeScreenSchemeImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { diff --git a/jira/internal/user_impl_test.go b/jira/internal/user_impl_test.go index 053952ff..176aba0d 100644 --- a/jira/internal/user_impl_test.go +++ b/jira/internal/user_impl_test.go @@ -37,7 +37,7 @@ func Test_internalUserImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountId: "uuid-sample", expand: []string{"groups", "applicationRoles"}, }, @@ -67,7 +67,7 @@ func Test_internalUserImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountId: "uuid-sample", expand: []string{"groups", "applicationRoles"}, }, @@ -97,7 +97,7 @@ func Test_internalUserImpl_Get(t *testing.T) { name: "when the account id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoAccountIDError, @@ -107,7 +107,7 @@ func Test_internalUserImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountId: "uuid-sample", expand: []string{"groups", "applicationRoles"}, }, @@ -186,7 +186,7 @@ func Test_internalUserImpl_Find(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountIds: []string{"uuid-sample-1", "uuid-sample-2"}, startAt: 50, maxResults: 25, @@ -217,7 +217,7 @@ func Test_internalUserImpl_Find(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountIds: []string{"uuid-sample-1", "uuid-sample-2"}, startAt: 50, maxResults: 25, @@ -248,7 +248,7 @@ func Test_internalUserImpl_Find(t *testing.T) { name: "when the account ids is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoAccountSliceError, @@ -258,7 +258,7 @@ func Test_internalUserImpl_Find(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountIds: []string{"uuid-sample-1", "uuid-sample-2"}, startAt: 50, maxResults: 25, @@ -337,7 +337,7 @@ func Test_internalUserImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountId: "uuid-sample", }, on: func(fields *fields) { @@ -366,7 +366,7 @@ func Test_internalUserImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountId: "uuid-sample", }, on: func(fields *fields) { @@ -395,7 +395,7 @@ func Test_internalUserImpl_Delete(t *testing.T) { name: "when the account id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoAccountIDError, @@ -405,7 +405,7 @@ func Test_internalUserImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountId: "uuid-sample", }, on: func(fields *fields) { @@ -480,7 +480,7 @@ func Test_internalUserImpl_Groups(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountId: "uuid-sample", }, on: func(fields *fields) { @@ -509,7 +509,7 @@ func Test_internalUserImpl_Groups(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountId: "uuid-sample", }, on: func(fields *fields) { @@ -538,7 +538,7 @@ func Test_internalUserImpl_Groups(t *testing.T) { name: "when the account id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoAccountIDError, @@ -548,7 +548,7 @@ func Test_internalUserImpl_Groups(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountId: "uuid-sample", }, on: func(fields *fields) { @@ -624,7 +624,7 @@ func Test_internalUserImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -652,7 +652,7 @@ func Test_internalUserImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -680,7 +680,7 @@ func Test_internalUserImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -761,7 +761,7 @@ func Test_internalUserImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -790,7 +790,7 @@ func Test_internalUserImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -819,7 +819,7 @@ func Test_internalUserImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { diff --git a/jira/internal/user_search_impl_test.go b/jira/internal/user_search_impl_test.go index 81637e22..ff7e54cb 100644 --- a/jira/internal/user_search_impl_test.go +++ b/jira/internal/user_search_impl_test.go @@ -38,7 +38,7 @@ func Test_internalUserSearchImpl_Projects(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountId: "uuid-sample", projectKeys: []string{"DUMMY", "KP"}, startAt: 100, @@ -70,7 +70,7 @@ func Test_internalUserSearchImpl_Projects(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountId: "uuid-sample", projectKeys: []string{"DUMMY", "KP"}, startAt: 100, @@ -102,7 +102,7 @@ func Test_internalUserSearchImpl_Projects(t *testing.T) { name: "when the project keys are not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectKeys: nil, }, wantErr: true, @@ -113,7 +113,7 @@ func Test_internalUserSearchImpl_Projects(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountId: "uuid-sample", projectKeys: []string{"DUMMY", "KP"}, startAt: 100, @@ -195,7 +195,7 @@ func Test_internalUserSearchImpl_Do(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountId: "uuid-sample", query: "charles.smith@example.com", startAt: 100, @@ -227,7 +227,7 @@ func Test_internalUserSearchImpl_Do(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountId: "uuid-sample", query: "charles.smith@example.com", startAt: 100, @@ -259,7 +259,7 @@ func Test_internalUserSearchImpl_Do(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), accountId: "uuid-sample", query: "charles.smith@example.com", startAt: 100, @@ -341,7 +341,7 @@ func Test_internalUserSearchImpl_Check(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permission: "CREATE_ISSUES", options: &model.UserPermissionCheckParamsScheme{ Query: "project A", @@ -378,7 +378,7 @@ func Test_internalUserSearchImpl_Check(t *testing.T) { name: "when the permission grant is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { client := mocks.NewConnector(t) @@ -392,7 +392,7 @@ func Test_internalUserSearchImpl_Check(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permission: "CREATE_ISSUES", options: &model.UserPermissionCheckParamsScheme{ Query: "project A", @@ -429,7 +429,7 @@ func Test_internalUserSearchImpl_Check(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), permission: "CREATE_ISSUES", options: &model.UserPermissionCheckParamsScheme{ Query: "project A", diff --git a/jira/internal/vote_impl_test.go b/jira/internal/vote_impl_test.go index a2906a11..86044b04 100644 --- a/jira/internal/vote_impl_test.go +++ b/jira/internal/vote_impl_test.go @@ -35,7 +35,7 @@ func Test_internalVoteImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", }, on: func(fields *fields) { @@ -65,7 +65,7 @@ func Test_internalVoteImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", }, on: func(fields *fields) { @@ -95,7 +95,7 @@ func Test_internalVoteImpl_Gets(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", }, wantErr: true, @@ -106,7 +106,7 @@ func Test_internalVoteImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", }, on: func(fields *fields) { @@ -183,7 +183,7 @@ func Test_internalVoteImpl_Add(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", }, on: func(fields *fields) { @@ -213,7 +213,7 @@ func Test_internalVoteImpl_Add(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", }, on: func(fields *fields) { @@ -243,7 +243,7 @@ func Test_internalVoteImpl_Add(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", }, wantErr: true, @@ -254,7 +254,7 @@ func Test_internalVoteImpl_Add(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", }, on: func(fields *fields) { @@ -330,7 +330,7 @@ func Test_internalVoteImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", }, on: func(fields *fields) { @@ -360,7 +360,7 @@ func Test_internalVoteImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", }, on: func(fields *fields) { @@ -390,7 +390,7 @@ func Test_internalVoteImpl_Delete(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", }, wantErr: true, @@ -401,7 +401,7 @@ func Test_internalVoteImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", }, on: func(fields *fields) { diff --git a/jira/internal/watcher_impl_test.go b/jira/internal/watcher_impl_test.go index 49a8f6aa..4469628a 100644 --- a/jira/internal/watcher_impl_test.go +++ b/jira/internal/watcher_impl_test.go @@ -35,7 +35,7 @@ func Test_internalWatcherImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", }, on: func(fields *fields) { @@ -65,7 +65,7 @@ func Test_internalWatcherImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", }, on: func(fields *fields) { @@ -95,7 +95,7 @@ func Test_internalWatcherImpl_Gets(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", }, wantErr: true, @@ -106,7 +106,7 @@ func Test_internalWatcherImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", }, on: func(fields *fields) { @@ -183,7 +183,7 @@ func Test_internalWatcherImpl_Add(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", }, on: func(fields *fields) { @@ -213,7 +213,7 @@ func Test_internalWatcherImpl_Add(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", }, on: func(fields *fields) { @@ -243,7 +243,7 @@ func Test_internalWatcherImpl_Add(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", }, wantErr: true, @@ -254,7 +254,7 @@ func Test_internalWatcherImpl_Add(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", }, on: func(fields *fields) { @@ -331,7 +331,7 @@ func Test_internalWatcherImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", accountId: "dummy-account-id", }, @@ -362,7 +362,7 @@ func Test_internalWatcherImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", accountId: "dummy-account-id", }, @@ -393,7 +393,7 @@ func Test_internalWatcherImpl_Delete(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "", }, wantErr: true, @@ -404,7 +404,7 @@ func Test_internalWatcherImpl_Delete(t *testing.T) { name: "when the account id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", accountId: "", }, @@ -416,7 +416,7 @@ func Test_internalWatcherImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", accountId: "dummy-account-id", }, diff --git a/jira/internal/workflow_impl_test.go b/jira/internal/workflow_impl_test.go index 1e5ee537..7c1f90b2 100644 --- a/jira/internal/workflow_impl_test.go +++ b/jira/internal/workflow_impl_test.go @@ -36,7 +36,7 @@ func Test_internalWorkflowImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.WorkflowSearchOptions{ WorkflowName: []string{"workflow-name"}, Expand: []string{"transitions"}, @@ -73,7 +73,7 @@ func Test_internalWorkflowImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.WorkflowSearchOptions{ WorkflowName: []string{"workflow-name"}, Expand: []string{"transitions"}, @@ -110,7 +110,7 @@ func Test_internalWorkflowImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.WorkflowSearchOptions{ WorkflowName: []string{"workflow-name"}, Expand: []string{"transitions"}, @@ -195,7 +195,7 @@ func Test_internalWorkflowImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), workflowId: "2838382882", }, on: func(fields *fields) { @@ -224,7 +224,7 @@ func Test_internalWorkflowImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), workflowId: "2838382882", }, on: func(fields *fields) { @@ -253,7 +253,7 @@ func Test_internalWorkflowImpl_Delete(t *testing.T) { name: "when the workflow id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkflowIDError, @@ -263,7 +263,7 @@ func Test_internalWorkflowImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), workflowId: "2838382882", }, on: func(fields *fields) { @@ -360,7 +360,7 @@ func Test_internalWorkflowImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -389,7 +389,7 @@ func Test_internalWorkflowImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -418,7 +418,7 @@ func Test_internalWorkflowImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { diff --git a/jira/internal/workflow_scheme_impl_test.go b/jira/internal/workflow_scheme_impl_test.go index a74037af..30056c4f 100644 --- a/jira/internal/workflow_scheme_impl_test.go +++ b/jira/internal/workflow_scheme_impl_test.go @@ -35,7 +35,7 @@ func Test_internalWorkflowSchemeImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), startAt: 50, maxResults: 25, }, @@ -65,7 +65,7 @@ func Test_internalWorkflowSchemeImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), startAt: 50, maxResults: 25, }, @@ -95,7 +95,7 @@ func Test_internalWorkflowSchemeImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), startAt: 50, maxResults: 25, }, @@ -172,7 +172,7 @@ func Test_internalWorkflowSchemeImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10002, returnDraftIfExists: true, }, @@ -202,7 +202,7 @@ func Test_internalWorkflowSchemeImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10002, returnDraftIfExists: true, }, @@ -232,7 +232,7 @@ func Test_internalWorkflowSchemeImpl_Get(t *testing.T) { name: "when the workflow scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkflowSchemeIDError, @@ -242,7 +242,7 @@ func Test_internalWorkflowSchemeImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10002, returnDraftIfExists: true, }, @@ -318,7 +318,7 @@ func Test_internalWorkflowSchemeImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10002, }, on: func(fields *fields) { @@ -347,7 +347,7 @@ func Test_internalWorkflowSchemeImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10002, }, on: func(fields *fields) { @@ -376,7 +376,7 @@ func Test_internalWorkflowSchemeImpl_Delete(t *testing.T) { name: "when the workflow scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkflowSchemeIDError, @@ -386,7 +386,7 @@ func Test_internalWorkflowSchemeImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10002, }, on: func(fields *fields) { @@ -460,7 +460,7 @@ func Test_internalWorkflowSchemeImpl_Associations(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectIds: []int{1002, 1003}, }, on: func(fields *fields) { @@ -489,7 +489,7 @@ func Test_internalWorkflowSchemeImpl_Associations(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectIds: []int{1002, 1003}, }, on: func(fields *fields) { @@ -518,7 +518,7 @@ func Test_internalWorkflowSchemeImpl_Associations(t *testing.T) { name: "when the project ids are not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoProjectsError, @@ -528,7 +528,7 @@ func Test_internalWorkflowSchemeImpl_Associations(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), projectIds: []int{1002, 1003}, }, on: func(fields *fields) { @@ -605,7 +605,7 @@ func Test_internalWorkflowSchemeImpl_Assign(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: "1004561", projectId: "4984838", }, @@ -635,7 +635,7 @@ func Test_internalWorkflowSchemeImpl_Assign(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: "1004561", projectId: "4984838", }, @@ -665,7 +665,7 @@ func Test_internalWorkflowSchemeImpl_Assign(t *testing.T) { name: "when the scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkflowSchemeIDError, @@ -675,7 +675,7 @@ func Test_internalWorkflowSchemeImpl_Assign(t *testing.T) { name: "when the project id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: "1004561", }, wantErr: true, @@ -686,7 +686,7 @@ func Test_internalWorkflowSchemeImpl_Assign(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: "1004561", projectId: "4984838", }, @@ -771,7 +771,7 @@ func Test_internalWorkflowSchemeImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10002, payload: payloadMocked, }, @@ -801,7 +801,7 @@ func Test_internalWorkflowSchemeImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10002, payload: payloadMocked, }, @@ -831,7 +831,7 @@ func Test_internalWorkflowSchemeImpl_Update(t *testing.T) { name: "when the workflow scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkflowSchemeIDError, @@ -841,7 +841,7 @@ func Test_internalWorkflowSchemeImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeId: 10002, payload: payloadMocked, }, @@ -927,7 +927,7 @@ func Test_internalWorkflowSchemeImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -956,7 +956,7 @@ func Test_internalWorkflowSchemeImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -985,7 +985,7 @@ func Test_internalWorkflowSchemeImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { diff --git a/jira/internal/workflow_scheme_issue_type_impl_test.go b/jira/internal/workflow_scheme_issue_type_impl_test.go index 5b507895..33923cab 100644 --- a/jira/internal/workflow_scheme_issue_type_impl_test.go +++ b/jira/internal/workflow_scheme_issue_type_impl_test.go @@ -38,7 +38,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: 10002, issueTypeID: "4", returnDraft: true, @@ -69,7 +69,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Get(t *testing.T) { name: "when the workflow scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkflowSchemeIDError, @@ -79,7 +79,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Get(t *testing.T) { name: "when the issue type id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: 10002, }, wantErr: true, @@ -90,7 +90,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: 10002, issueTypeID: "4", returnDraft: true, @@ -121,7 +121,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: 10002, issueTypeID: "4", returnDraft: true, @@ -201,7 +201,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Mapping(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: 10002, workflowName: "jira workflow ", returnDraft: true, @@ -232,7 +232,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Mapping(t *testing.T) { name: "when the workflow scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkflowSchemeIDError, @@ -242,7 +242,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Mapping(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: 10002, workflowName: "jira workflow ", returnDraft: true, @@ -273,7 +273,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Mapping(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: 10002, workflowName: "jira workflow ", returnDraft: true, @@ -353,7 +353,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: 10002, issueTypeID: "4", updateDraft: true, @@ -384,7 +384,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Delete(t *testing.T) { name: "when the workflow scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkflowSchemeIDError, @@ -394,7 +394,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Delete(t *testing.T) { name: "when the issue type id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: 10002, }, wantErr: true, @@ -405,7 +405,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: 10002, issueTypeID: "4", updateDraft: true, @@ -436,7 +436,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: 10002, issueTypeID: "4", updateDraft: true, @@ -522,7 +522,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Set(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: 10002, issueTypeID: "4", payload: payloadMocked, @@ -553,7 +553,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Set(t *testing.T) { name: "when the workflow scheme id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkflowSchemeIDError, @@ -563,7 +563,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Set(t *testing.T) { name: "when the issue type id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: 10002, }, wantErr: true, @@ -574,7 +574,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Set(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: 10002, issueTypeID: "4", payload: payloadMocked, @@ -605,7 +605,7 @@ func Test_internalWorkflowSchemeIssueTypeImpl_Set(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), schemeID: 10002, issueTypeID: "4", payload: payloadMocked, diff --git a/jira/internal/workflow_status_impl_test.go b/jira/internal/workflow_status_impl_test.go index 93ad085e..f3125be3 100644 --- a/jira/internal/workflow_status_impl_test.go +++ b/jira/internal/workflow_status_impl_test.go @@ -36,7 +36,7 @@ func Test_internalWorkflowStatusImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), ids: []string{"10000", "10001"}, expand: []string{"usages"}, }, @@ -66,7 +66,7 @@ func Test_internalWorkflowStatusImpl_Gets(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), ids: []string{"10000", "10001"}, expand: []string{"usages"}, }, @@ -96,7 +96,7 @@ func Test_internalWorkflowStatusImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), ids: []string{"10000", "10001"}, expand: []string{"usages"}, }, @@ -190,7 +190,7 @@ func Test_internalWorkflowStatusImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -219,7 +219,7 @@ func Test_internalWorkflowStatusImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -248,7 +248,7 @@ func Test_internalWorkflowStatusImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -364,7 +364,7 @@ func Test_internalWorkflowStatusImpl_Create(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -393,7 +393,7 @@ func Test_internalWorkflowStatusImpl_Create(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -421,7 +421,7 @@ func Test_internalWorkflowStatusImpl_Create(t *testing.T) { name: "when the payload does not have statuses", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMockedWithOutStatuses, }, on: func(fields *fields) { @@ -438,7 +438,7 @@ func Test_internalWorkflowStatusImpl_Create(t *testing.T) { name: "when the payload does not have a scope", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMockedWithOutScope, }, on: func(fields *fields) { @@ -455,7 +455,7 @@ func Test_internalWorkflowStatusImpl_Create(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), payload: payloadMocked, }, on: func(fields *fields) { @@ -531,7 +531,7 @@ func Test_internalWorkflowStatusImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), ids: []string{"10000", "10001"}, }, on: func(fields *fields) { @@ -560,7 +560,7 @@ func Test_internalWorkflowStatusImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), ids: []string{"10000", "10001"}, }, on: func(fields *fields) { @@ -589,7 +589,7 @@ func Test_internalWorkflowStatusImpl_Delete(t *testing.T) { name: "when the statuses ids are not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoWorkflowStatusesError, @@ -599,7 +599,7 @@ func Test_internalWorkflowStatusImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), ids: []string{"10000", "10001"}, }, on: func(fields *fields) { @@ -675,7 +675,7 @@ func Test_internalWorkflowStatusImpl_Search(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.WorkflowStatusSearchParams{ ProjectID: "8373772", SearchString: "UAT", @@ -711,7 +711,7 @@ func Test_internalWorkflowStatusImpl_Search(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.WorkflowStatusSearchParams{ ProjectID: "8373772", SearchString: "UAT", @@ -747,7 +747,7 @@ func Test_internalWorkflowStatusImpl_Search(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), options: &model.WorkflowStatusSearchParams{ ProjectID: "8373772", SearchString: "UAT", @@ -830,7 +830,7 @@ func Test_internalWorkflowStatusImpl_Bulk(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -858,7 +858,7 @@ func Test_internalWorkflowStatusImpl_Bulk(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -886,7 +886,7 @@ func Test_internalWorkflowStatusImpl_Bulk(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, on: func(fields *fields) { @@ -961,7 +961,7 @@ func Test_internalWorkflowStatusImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), idOrName: "TODO", }, on: func(fields *fields) { @@ -990,7 +990,7 @@ func Test_internalWorkflowStatusImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), idOrName: "TODO", }, on: func(fields *fields) { @@ -1019,7 +1019,7 @@ func Test_internalWorkflowStatusImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), idOrName: "TODO", }, on: func(fields *fields) { diff --git a/jira/internal/worklog_impl_adf_test.go b/jira/internal/worklog_impl_adf_test.go index f76089e8..9c2b1d70 100644 --- a/jira/internal/worklog_impl_adf_test.go +++ b/jira/internal/worklog_impl_adf_test.go @@ -39,7 +39,7 @@ func Test_internalWorklogAdfImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), worklogIds: []int{1, 2, 3, 4}, expand: []string{"properties"}, }, @@ -69,7 +69,7 @@ func Test_internalWorklogAdfImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), worklogIds: []int{1, 2, 3, 4}, expand: []string{"properties"}, }, @@ -99,7 +99,7 @@ func Test_internalWorklogAdfImpl_Gets(t *testing.T) { name: "when the worklogs ids are not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNpWorklogsError, @@ -109,7 +109,7 @@ func Test_internalWorklogAdfImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), worklogIds: []int{1, 2, 3, 4}, expand: []string{"properties"}, }, @@ -187,7 +187,7 @@ func Test_internalWorklogAdfImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", worklogId: "493939", expand: []string{"properties"}, @@ -218,7 +218,7 @@ func Test_internalWorklogAdfImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", worklogId: "493939", expand: []string{"properties"}, @@ -249,7 +249,7 @@ func Test_internalWorklogAdfImpl_Get(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoIssueKeyOrIDError, @@ -259,7 +259,7 @@ func Test_internalWorklogAdfImpl_Get(t *testing.T) { name: "when the worklog id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", }, wantErr: true, @@ -270,7 +270,7 @@ func Test_internalWorklogAdfImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", worklogId: "493939", expand: []string{"properties"}, @@ -350,7 +350,7 @@ func Test_internalWorklogAdfImpl_Issue(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", startAt: 0, maxResults: 50, @@ -383,7 +383,7 @@ func Test_internalWorklogAdfImpl_Issue(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", startAt: 0, maxResults: 50, @@ -416,7 +416,7 @@ func Test_internalWorklogAdfImpl_Issue(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoIssueKeyOrIDError, @@ -426,7 +426,7 @@ func Test_internalWorklogAdfImpl_Issue(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", startAt: 0, maxResults: 50, @@ -508,7 +508,7 @@ func Test_internalWorklogAdfImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", worklogId: "h837372", options: &model.WorklogOptionsScheme{ @@ -546,7 +546,7 @@ func Test_internalWorklogAdfImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", worklogId: "h837372", options: &model.WorklogOptionsScheme{ @@ -584,7 +584,7 @@ func Test_internalWorklogAdfImpl_Delete(t *testing.T) { name: "when the options are not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", worklogId: "h837372", }, @@ -614,7 +614,7 @@ func Test_internalWorklogAdfImpl_Delete(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoIssueKeyOrIDError, @@ -624,7 +624,7 @@ func Test_internalWorklogAdfImpl_Delete(t *testing.T) { name: "when the worklog id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", }, wantErr: true, @@ -635,7 +635,7 @@ func Test_internalWorklogAdfImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", worklogId: "h837372", }, @@ -712,7 +712,7 @@ func Test_internalWorklogAdfImpl_Deleted(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), since: 928281811, }, on: func(fields *fields) { @@ -741,7 +741,7 @@ func Test_internalWorklogAdfImpl_Deleted(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), since: 928281811, }, on: func(fields *fields) { @@ -770,7 +770,7 @@ func Test_internalWorklogAdfImpl_Deleted(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), since: 928281811, }, on: func(fields *fields) { @@ -847,7 +847,7 @@ func Test_internalWorklogAdfImpl_Updated(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), since: 928281811, expand: []string{"properties"}, }, @@ -877,7 +877,7 @@ func Test_internalWorklogAdfImpl_Updated(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), since: 928281811, expand: []string{"properties"}, }, @@ -907,7 +907,7 @@ func Test_internalWorklogAdfImpl_Updated(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), since: 928281811, expand: []string{"properties"}, }, @@ -1012,7 +1012,7 @@ func Test_internalWorklogAdfImpl_Add(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrID: "DUMMY-5", payload: payloadMocked, options: &model.WorklogOptionsScheme{ @@ -1050,7 +1050,7 @@ func Test_internalWorklogAdfImpl_Add(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrID: "DUMMY-5", payload: payloadMocked, options: &model.WorklogOptionsScheme{ @@ -1088,7 +1088,7 @@ func Test_internalWorklogAdfImpl_Add(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrID: "DUMMY-5", payload: payloadMocked, options: &model.WorklogOptionsScheme{ @@ -1202,7 +1202,7 @@ func Test_internalWorklogAdfImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrID: "DUMMY-5", worklogId: "3933828822", payload: payloadMocked, @@ -1241,7 +1241,7 @@ func Test_internalWorklogAdfImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrID: "DUMMY-5", worklogId: "3933828822", payload: payloadMocked, @@ -1280,7 +1280,7 @@ func Test_internalWorklogAdfImpl_Update(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoIssueKeyOrIDError, @@ -1290,7 +1290,7 @@ func Test_internalWorklogAdfImpl_Update(t *testing.T) { name: "when the worklog id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrID: "DUMMY-5", }, wantErr: true, @@ -1301,7 +1301,7 @@ func Test_internalWorklogAdfImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrID: "DUMMY-5", worklogId: "3933828822", payload: payloadMocked, diff --git a/jira/internal/worklog_impl_rich_text_test.go b/jira/internal/worklog_impl_rich_text_test.go index b628b569..92c9d4bb 100644 --- a/jira/internal/worklog_impl_rich_text_test.go +++ b/jira/internal/worklog_impl_rich_text_test.go @@ -39,7 +39,7 @@ func Test_internalWorklogRichTextImpl_Gets(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), worklogIds: []int{1, 2, 3, 4}, expand: []string{"properties"}, }, @@ -69,7 +69,7 @@ func Test_internalWorklogRichTextImpl_Gets(t *testing.T) { name: "when the worklogs ids are not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNpWorklogsError, @@ -79,7 +79,7 @@ func Test_internalWorklogRichTextImpl_Gets(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), worklogIds: []int{1, 2, 3, 4}, expand: []string{"properties"}, }, @@ -157,7 +157,7 @@ func Test_internalWorklogRichTextImpl_Get(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", worklogId: "493939", expand: []string{"properties"}, @@ -188,7 +188,7 @@ func Test_internalWorklogRichTextImpl_Get(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", worklogId: "493939", expand: []string{"properties"}, @@ -219,7 +219,7 @@ func Test_internalWorklogRichTextImpl_Get(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoIssueKeyOrIDError, @@ -229,7 +229,7 @@ func Test_internalWorklogRichTextImpl_Get(t *testing.T) { name: "when the worklog id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", }, wantErr: true, @@ -240,7 +240,7 @@ func Test_internalWorklogRichTextImpl_Get(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", worklogId: "493939", expand: []string{"properties"}, @@ -320,7 +320,7 @@ func Test_internalWorklogRichTextImpl_Issue(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", startAt: 0, maxResults: 50, @@ -353,7 +353,7 @@ func Test_internalWorklogRichTextImpl_Issue(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", startAt: 0, maxResults: 50, @@ -386,7 +386,7 @@ func Test_internalWorklogRichTextImpl_Issue(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoIssueKeyOrIDError, @@ -396,7 +396,7 @@ func Test_internalWorklogRichTextImpl_Issue(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", startAt: 0, maxResults: 50, @@ -478,7 +478,7 @@ func Test_internalWorklogRichTextImpl_Delete(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", worklogId: "h837372", options: &model.WorklogOptionsScheme{ @@ -516,7 +516,7 @@ func Test_internalWorklogRichTextImpl_Delete(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", worklogId: "h837372", options: &model.WorklogOptionsScheme{ @@ -554,7 +554,7 @@ func Test_internalWorklogRichTextImpl_Delete(t *testing.T) { name: "when the options are not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", worklogId: "h837372", }, @@ -584,7 +584,7 @@ func Test_internalWorklogRichTextImpl_Delete(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoIssueKeyOrIDError, @@ -594,7 +594,7 @@ func Test_internalWorklogRichTextImpl_Delete(t *testing.T) { name: "when the worklog id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", }, wantErr: true, @@ -605,7 +605,7 @@ func Test_internalWorklogRichTextImpl_Delete(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrId: "DUMMY-5", worklogId: "h837372", }, @@ -682,7 +682,7 @@ func Test_internalWorklogRichTextImpl_Deleted(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), since: 928281811, }, on: func(fields *fields) { @@ -711,7 +711,7 @@ func Test_internalWorklogRichTextImpl_Deleted(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), since: 928281811, }, on: func(fields *fields) { @@ -740,7 +740,7 @@ func Test_internalWorklogRichTextImpl_Deleted(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), since: 928281811, }, on: func(fields *fields) { @@ -817,7 +817,7 @@ func Test_internalWorklogRichTextImpl_Updated(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), since: 928281811, expand: []string{"properties"}, }, @@ -847,7 +847,7 @@ func Test_internalWorklogRichTextImpl_Updated(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), since: 928281811, expand: []string{"properties"}, }, @@ -877,7 +877,7 @@ func Test_internalWorklogRichTextImpl_Updated(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), since: 928281811, expand: []string{"properties"}, }, @@ -969,7 +969,7 @@ func Test_internalWorklogRichTextImpl_Add(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrID: "DUMMY-5", payload: payloadMocked, options: &model.WorklogOptionsScheme{ @@ -1007,7 +1007,7 @@ func Test_internalWorklogRichTextImpl_Add(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrID: "DUMMY-5", payload: payloadMocked, options: &model.WorklogOptionsScheme{ @@ -1045,7 +1045,7 @@ func Test_internalWorklogRichTextImpl_Add(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrID: "DUMMY-5", payload: payloadMocked, options: &model.WorklogOptionsScheme{ @@ -1144,7 +1144,7 @@ func Test_internalWorklogRichTextImpl_Update(t *testing.T) { name: "when the api version is v3", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrID: "DUMMY-5", worklogId: "3933828822", payload: payloadMocked, @@ -1183,7 +1183,7 @@ func Test_internalWorklogRichTextImpl_Update(t *testing.T) { name: "when the api version is v2", fields: fields{version: "2"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrID: "DUMMY-5", worklogId: "3933828822", payload: payloadMocked, @@ -1222,7 +1222,7 @@ func Test_internalWorklogRichTextImpl_Update(t *testing.T) { name: "when the issue key or id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), }, wantErr: true, Err: model.ErrNoIssueKeyOrIDError, @@ -1232,7 +1232,7 @@ func Test_internalWorklogRichTextImpl_Update(t *testing.T) { name: "when the worklog id is not provided", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrID: "DUMMY-5", }, wantErr: true, @@ -1243,7 +1243,7 @@ func Test_internalWorklogRichTextImpl_Update(t *testing.T) { name: "when the http request cannot be created", fields: fields{version: "3"}, args: args{ - ctx: context.TODO(), + ctx: context.Background(), issueKeyOrID: "DUMMY-5", worklogId: "3933828822", payload: payloadMocked, diff --git a/jira/sm/api_client_impl_test.go b/jira/sm/api_client_impl_test.go index 23d7eac8..720821b2 100644 --- a/jira/sm/api_client_impl_test.go +++ b/jira/sm/api_client_impl_test.go @@ -291,7 +291,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: "rest/2/issue/attachment", type_: "", @@ -309,7 +309,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: " https://zhidao.baidu.com/special/view?id=49105a24626975510000&preview=1", body: bytes.NewReader([]byte("Hello World")), diff --git a/jira/v2/api_client_impl_test.go b/jira/v2/api_client_impl_test.go index ec14ebb7..d1805bcd 100644 --- a/jira/v2/api_client_impl_test.go +++ b/jira/v2/api_client_impl_test.go @@ -291,7 +291,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: "rest/2/issue/attachment", type_: "", @@ -309,7 +309,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: "rest/2/issue/attachment", type_: "type_sample", @@ -327,7 +327,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: " https://zhidao.baidu.com/special/view?id=49105a24626975510000&preview=1", body: bytes.NewReader([]byte("Hello World")), diff --git a/jira/v3/api_client_impl_test.go b/jira/v3/api_client_impl_test.go index 0987d079..1e105415 100644 --- a/jira/v3/api_client_impl_test.go +++ b/jira/v3/api_client_impl_test.go @@ -291,7 +291,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: "rest/2/issue/attachment", type_: "", @@ -309,7 +309,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: " https://zhidao.baidu.com/special/view?id=49105a24626975510000&preview=1", body: bytes.NewReader([]byte("Hello World")), @@ -326,7 +326,7 @@ func TestClient_NewRequest(t *testing.T) { Site: siteAsURL, }, args: args{ - ctx: context.TODO(), + ctx: context.Background(), method: http.MethodGet, urlStr: "rest/2/issue/attachment", type_: "type_sample", diff --git a/pkg/infra/models/admin_organization.go b/pkg/infra/models/admin_organization.go index 6e241fcd..af661562 100644 --- a/pkg/infra/models/admin_organization.go +++ b/pkg/infra/models/admin_organization.go @@ -1,118 +1,137 @@ +// Package models provides the data structures used in the admin package. package models import "time" +// AdminOrganizationPageScheme represents a page of organizations. type AdminOrganizationPageScheme struct { - Data []*OrganizationModelScheme `json:"data,omitempty"` - Links *LinkPageModelScheme `json:"links,omitempty"` + Data []*OrganizationModelScheme `json:"data,omitempty"` // The organizations on this page. + Links *LinkPageModelScheme `json:"links,omitempty"` // Links to other pages. } +// LinkPageModelScheme represents the links to other pages. type LinkPageModelScheme struct { - Self string `json:"self,omitempty"` - Prev string `json:"prev,omitempty"` - Next string `json:"next,omitempty"` + Self string `json:"self,omitempty"` // Link to this page. + Prev string `json:"prev,omitempty"` // Link to the previous page. + Next string `json:"next,omitempty"` // Link to the next page. } +// OrganizationModelScheme represents an organization. type OrganizationModelScheme struct { - ID string `json:"id,omitempty"` - Type string `json:"type,omitempty"` - Attributes *OrganizationModelAttribute `json:"attributes,omitempty"` - Relationships *OrganizationModelRelationships `json:"relationships,omitempty"` - Links *LinkSelfModelScheme `json:"links,omitempty"` + ID string `json:"id,omitempty"` // The ID of the organization. + Type string `json:"type,omitempty"` // The type of the organization. + Attributes *OrganizationModelAttribute `json:"attributes,omitempty"` // The attributes of the organization. + Relationships *OrganizationModelRelationships `json:"relationships,omitempty"` // The relationships of the organization. + Links *LinkSelfModelScheme `json:"links,omitempty"` // Links related to the organization. } +// OrganizationModelAttribute represents the attributes of an organization. type OrganizationModelAttribute struct { - Name string `json:"name,omitempty"` + Name string `json:"name,omitempty"` // The name of the organization. } +// OrganizationModelRelationships represents the relationships of an organization. type OrganizationModelRelationships struct { - Domains *OrganizationModelSchemes `json:"domains,omitempty"` - Users *OrganizationModelSchemes `json:"users,omitempty"` + Domains *OrganizationModelSchemes `json:"domains,omitempty"` // The domains of the organization. + Users *OrganizationModelSchemes `json:"users,omitempty"` // The users of the organization. } +// OrganizationModelSchemes represents the links to related entities. type OrganizationModelSchemes struct { Links struct { - Related string `json:"related,omitempty"` + Related string `json:"related,omitempty"` // Link to the related entity. } `json:"links,omitempty"` } +// LinkSelfModelScheme represents a link to the entity itself. type LinkSelfModelScheme struct { - Self string `json:"self,omitempty"` + Self string `json:"self,omitempty"` // Link to the entity itself. } +// AdminOrganizationScheme represents an organization. type AdminOrganizationScheme struct { - Data *OrganizationModelScheme `json:"data,omitempty"` + Data *OrganizationModelScheme `json:"data,omitempty"` // The organization data. } +// OrganizationUserPageScheme represents a page of users in an organization. type OrganizationUserPageScheme struct { - Data []*AdminOrganizationUserScheme `json:"data,omitempty"` - Links *LinkPageModelScheme `json:"links,omitempty"` + Data []*AdminOrganizationUserScheme `json:"data,omitempty"` // The users on this page. + Links *LinkPageModelScheme `json:"links,omitempty"` // Links to other pages. Meta struct { - Total int `json:"total,omitempty"` + Total int `json:"total,omitempty"` // The total number of users. } `json:"meta,omitempty"` } +// AdminOrganizationUserScheme represents a user in an organization. type AdminOrganizationUserScheme struct { - AccountID string `json:"account_id,omitempty"` - AccountType string `json:"account_type,omitempty"` - AccountStatus string `json:"account_status,omitempty"` - Name string `json:"name,omitempty"` - Picture string `json:"picture,omitempty"` - Email string `json:"email,omitempty"` - AccessBillable bool `json:"access_billable,omitempty"` - LastActive string `json:"last_active,omitempty"` - ProductAccess []*OrganizationUserProductScheme `json:"product_access,omitempty"` - Links *LinkSelfModelScheme `json:"links,omitempty"` -} - + AccountID string `json:"account_id,omitempty"` // The account ID of the user. + AccountType string `json:"account_type,omitempty"` // The account type of the user. + AccountStatus string `json:"account_status,omitempty"` // The account status of the user. + Name string `json:"name,omitempty"` // The name of the user. + Picture string `json:"picture,omitempty"` // The picture of the user. + Email string `json:"email,omitempty"` // The email of the user. + AccessBillable bool `json:"access_billable,omitempty"` // Whether the user is billable. + LastActive string `json:"last_active,omitempty"` // The last active time of the user. + ProductAccess []*OrganizationUserProductScheme `json:"product_access,omitempty"` // The products the user has access to. + Links *LinkSelfModelScheme `json:"links,omitempty"` // Links related to the user. +} + +// OrganizationUserProductScheme represents a product a user has access to. type OrganizationUserProductScheme struct { - Key string `json:"key,omitempty"` - Name string `json:"name,omitempty"` - URL string `json:"url,omitempty"` - LastActive string `json:"last_active,omitempty"` + Key string `json:"key,omitempty"` // The key of the product. + Name string `json:"name,omitempty"` // The name of the product. + URL string `json:"url,omitempty"` // The URL of the product. + LastActive string `json:"last_active,omitempty"` // The last active time of the product. } +// OrganizationDomainPageScheme represents a page of domains in an organization. type OrganizationDomainPageScheme struct { - Data []*OrganizationDomainModelScheme `json:"data,omitempty"` - Links *LinkPageModelScheme `json:"links,omitempty"` + Data []*OrganizationDomainModelScheme `json:"data,omitempty"` // The domains on this page. + Links *LinkPageModelScheme `json:"links,omitempty"` // Links to other pages. } +// OrganizationDomainModelScheme represents a domain in an organization. type OrganizationDomainModelScheme struct { - ID string `json:"id,omitempty"` - Type string `json:"type,omitempty"` - Attributes *OrganizationDomainModelAttributesScheme `json:"attributes,omitempty"` - Links *LinkSelfModelScheme `json:"links,omitempty"` + ID string `json:"id,omitempty"` // The ID of the domain. + Type string `json:"type,omitempty"` // The type of the domain. + Attributes *OrganizationDomainModelAttributesScheme `json:"attributes,omitempty"` // The attributes of the domain. + Links *LinkSelfModelScheme `json:"links,omitempty"` // Links related to the domain. } +// OrganizationDomainModelAttributesScheme represents the attributes of a domain. type OrganizationDomainModelAttributesScheme struct { - Name string `json:"name,omitempty"` - Claim *OrganizationDomainModelAttributeClaimScheme `json:"claim,omitempty"` + Name string `json:"name,omitempty"` // The name of the domain. + Claim *OrganizationDomainModelAttributeClaimScheme `json:"claim,omitempty"` // The claim of the domain. } +// OrganizationDomainModelAttributeClaimScheme represents the claim of a domain. type OrganizationDomainModelAttributeClaimScheme struct { - Type string `json:"type,omitempty"` - Status string `json:"status,omitempty"` + Type string `json:"type,omitempty"` // The type of the claim. + Status string `json:"status,omitempty"` // The status of the claim. } +// OrganizationDomainScheme represents a domain. type OrganizationDomainScheme struct { - Data *OrganizationDomainDataScheme `json:"data"` + Data *OrganizationDomainDataScheme `json:"data"` // The domain data. } +// OrganizationDomainDataScheme represents the data of a domain. type OrganizationDomainDataScheme struct { - ID string `json:"id"` - Type string `json:"type"` + ID string `json:"id"` // The ID of the domain. + Type string `json:"type"` // The type of the domain. Attributes struct { - Name string `json:"name"` + Name string `json:"name"` // The name of the domain. Claim struct { - Type string `json:"type"` - Status string `json:"status"` - } `json:"claim"` - } `json:"attributes"` + Type string `json:"type"` // The type of the claim. + Status string `json:"status"` // The status of the claim. + } `json:"claim"` // The claim of the domain. + } `json:"attributes"` // The attributes of the domain. Links struct { - Self string `json:"self"` - } `json:"links"` + Self string `json:"self"` // Link to the domain itself. + } `json:"links"` // Links related to the domain. } +// OrganizationEventOptScheme represents the options for getting events. type OrganizationEventOptScheme struct { Q string //Single query term for searching events. From time.Time //The earliest date and time of the event represented as a UNIX epoch time. @@ -120,87 +139,101 @@ type OrganizationEventOptScheme struct { Action string //A query filter that returns events of a specific action type. } +// OrganizationEventPageScheme represents a page of events in an organization. type OrganizationEventPageScheme struct { - Data []*OrganizationEventModelScheme `json:"data,omitempty"` - Links *LinkPageModelScheme `json:"links,omitempty"` + Data []*OrganizationEventModelScheme `json:"data,omitempty"` // The events on this page. + Links *LinkPageModelScheme `json:"links,omitempty"` // Links to other pages. Meta struct { - Next string `json:"next,omitempty"` - PageSize int `json:"page_size,omitempty"` + Next string `json:"next,omitempty"` // The next page. + PageSize int `json:"page_size,omitempty"` // The page size. } `json:"meta,omitempty"` } +// OrganizationEventModelScheme represents an event in an organization. type OrganizationEventModelScheme struct { - ID string `json:"id,omitempty"` - Type string `json:"type,omitempty"` - Attributes *OrganizationEventModelAttributesScheme `json:"attributes,omitempty"` - Links *LinkSelfModelScheme `json:"links,omitempty"` + ID string `json:"id,omitempty"` // The ID of the event. + Type string `json:"type,omitempty"` // The type of the event. + Attributes *OrganizationEventModelAttributesScheme `json:"attributes,omitempty"` // The attributes of the event. + Links *LinkSelfModelScheme `json:"links,omitempty"` // Links related to the event. } +// OrganizationEventModelAttributesScheme represents the attributes of an event. type OrganizationEventModelAttributesScheme struct { - Time string `json:"time,omitempty"` - Action string `json:"action,omitempty"` - Actor *OrganizationEventActorModel `json:"actor,omitempty"` - Context []*OrganizationEventObjectModel `json:"context,omitempty"` - Container []*OrganizationEventObjectModel `json:"container,omitempty"` - Location *OrganizationEventLocationModel `json:"location,omitempty"` + Time string `json:"time,omitempty"` // The time of the event. + Action string `json:"action,omitempty"` // The action of the event. + Actor *OrganizationEventActorModel `json:"actor,omitempty"` // The actor of the event. + Context []*OrganizationEventObjectModel `json:"context,omitempty"` // The context of the event. + Container []*OrganizationEventObjectModel `json:"container,omitempty"` // The container of the event. + Location *OrganizationEventLocationModel `json:"location,omitempty"` // The location of the event. } +// OrganizationEventActorModel represents the actor of an event. type OrganizationEventActorModel struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Links *LinkSelfModelScheme `json:"links,omitempty"` + ID string `json:"id,omitempty"` // The ID of the actor. + Name string `json:"name,omitempty"` // The name of the actor. + Links *LinkSelfModelScheme `json:"links,omitempty"` // Links related to the actor. } +// OrganizationEventObjectModel represents an object in the context or container of an event. type OrganizationEventObjectModel struct { - ID string `json:"id,omitempty"` - Type string `json:"type,omitempty"` + ID string `json:"id,omitempty"` // The ID of the object. + Type string `json:"type,omitempty"` // The type of the object. Links struct { - Self string `json:"self,omitempty"` - Alt string `json:"alt,omitempty"` - } `json:"links,omitempty"` + Self string `json:"self,omitempty"` // Link to the object itself. + Alt string `json:"alt,omitempty"` // Alternative link to the object. + } `json:"links,omitempty"` // Links related to the object. } +// OrganizationEventLocationModel represents the location of an event. type OrganizationEventLocationModel struct { - IP string `json:"ip,omitempty"` - Geo string `json:"geo,omitempty"` + IP string `json:"ip,omitempty"` // The IP address of the location. + Geo string `json:"geo,omitempty"` // The geographical location. } +// OrganizationEventScheme represents an event. type OrganizationEventScheme struct { - Data *OrganizationEventModelScheme `json:"data,omitempty"` + Data *OrganizationEventModelScheme `json:"data,omitempty"` // The event data. } +// OrganizationEventActionScheme represents an action in an event. type OrganizationEventActionScheme struct { - Data []*OrganizationEventActionModelScheme `json:"data,omitempty"` + Data []*OrganizationEventActionModelScheme `json:"data,omitempty"` // The action data. } +// OrganizationEventActionModelScheme represents an action in an event. type OrganizationEventActionModelScheme struct { - ID string `json:"id,omitempty"` - Type string `json:"type,omitempty"` - Attributes *OrganizationEventActionModelAttributesScheme `json:"attributes,omitempty"` + ID string `json:"id,omitempty"` // The ID of the action. + Type string `json:"type,omitempty"` // The type of the action. + Attributes *OrganizationEventActionModelAttributesScheme `json:"attributes,omitempty"` // The attributes of the action. } +// OrganizationEventActionModelAttributesScheme represents the attributes of an action in an event. type OrganizationEventActionModelAttributesScheme struct { - DisplayName string `json:"displayName,omitempty"` - GroupDisplayName string `json:"groupDisplayName,omitempty"` + DisplayName string `json:"displayName,omitempty"` // The display name of the action. + GroupDisplayName string `json:"groupDisplayName,omitempty"` // The group display name of the action. } +// UserProductAccessScheme represents the product access of a user. type UserProductAccessScheme struct { - Data *UserProductAccessDataScheme `json:"data,omitempty"` + Data *UserProductAccessDataScheme `json:"data,omitempty"` // The product access data. } +// UserProductAccessDataScheme represents the data of a user's product access. type UserProductAccessDataScheme struct { - ProductAccess []*UserProductLastActiveScheme `json:"product_access,omitempty"` - AddedToOrg string `json:"added_to_org,omitempty"` + ProductAccess []*UserProductLastActiveScheme `json:"product_access,omitempty"` // The products the user has access to. + AddedToOrg string `json:"added_to_org,omitempty"` // The time the user was added to the organization. } +// UserProductLastActiveScheme represents a product a user has access to. type UserProductLastActiveScheme struct { - Id string `json:"id,omitempty"` - Key string `json:"key,omitempty"` - Name string `json:"name,omitempty"` - Url string `json:"url,omitempty"` - LastActive string `json:"last_active,omitempty"` + Id string `json:"id,omitempty"` // The ID of the product. + Key string `json:"key,omitempty"` // The key of the product. + Name string `json:"name,omitempty"` // The name of the product. + Url string `json:"url,omitempty"` // The URL of the product. + LastActive string `json:"last_active,omitempty"` // The last active time of the product. } +// GenericActionSuccessScheme represents a successful action. type GenericActionSuccessScheme struct { - Message string `json:"message,omitempty"` + Message string `json:"message,omitempty"` // The success message. } diff --git a/pkg/infra/models/admin_organization_policy.go b/pkg/infra/models/admin_organization_policy.go index a8577e47..3a4b4ac3 100644 --- a/pkg/infra/models/admin_organization_policy.go +++ b/pkg/infra/models/admin_organization_policy.go @@ -1,36 +1,42 @@ +// Package models provides the data structures used in the admin package. package models import "time" +// OrganizationPolicyPageScheme represents a page of organization policies. type OrganizationPolicyPageScheme struct { - Data []*OrganizationPolicyData `json:"data,omitempty"` - Links *LinkPageModelScheme `json:"links,omitempty"` + Data []*OrganizationPolicyData `json:"data,omitempty"` // The organization policies on this page. + Links *LinkPageModelScheme `json:"links,omitempty"` // Links to other pages. Meta struct { - Next string `json:"next,omitempty"` - PageSize int `json:"page_size,omitempty"` - } `json:"meta,omitempty"` + Next string `json:"next,omitempty"` // The next page. + PageSize int `json:"page_size,omitempty"` // The page size. + } `json:"meta,omitempty"` // Metadata about the page. } +// OrganizationPolicyScheme represents an organization policy. type OrganizationPolicyScheme struct { - Data OrganizationPolicyData `json:"data,omitempty"` + Data OrganizationPolicyData `json:"data,omitempty"` // The organization policy data. } +// OrganizationPolicyResource represents a resource in an organization policy. type OrganizationPolicyResource struct { - ID string `json:"id,omitempty"` - ApplicationStatus string `json:"applicationStatus,omitempty"` + ID string `json:"id,omitempty"` // The ID of the resource. + ApplicationStatus string `json:"applicationStatus,omitempty"` // The application status of the resource. } +// OrganizationPolicyAttributes represents the attributes of an organization policy. type OrganizationPolicyAttributes struct { - Type string `json:"type,omitempty"` - Name string `json:"name,omitempty"` - Status string `json:"status,omitempty"` - Resources []*OrganizationPolicyResource `json:"resources,omitempty"` - CreatedAt time.Time `json:"createdAt,omitempty"` - UpdatedAt time.Time `json:"updatedAt,omitempty"` + Type string `json:"type,omitempty"` // The type of the policy. + Name string `json:"name,omitempty"` // The name of the policy. + Status string `json:"status,omitempty"` // The status of the policy. + Resources []*OrganizationPolicyResource `json:"resources,omitempty"` // The resources of the policy. + CreatedAt time.Time `json:"createdAt,omitempty"` // The creation time of the policy. + UpdatedAt time.Time `json:"updatedAt,omitempty"` // The update time of the policy. } +// OrganizationPolicyData represents the data of an organization policy. type OrganizationPolicyData struct { - ID string `json:"id,omitempty"` - Type string `json:"type,omitempty"` - Attributes *OrganizationPolicyAttributes `json:"attributes,omitempty"` + ID string `json:"id,omitempty"` // The ID of the policy. + Type string `json:"type,omitempty"` // The type of the policy. + Attributes *OrganizationPolicyAttributes `json:"attributes,omitempty"` // The attributes of the policy. } diff --git a/pkg/infra/models/admin_scim_group.go b/pkg/infra/models/admin_scim_group.go index ded9d4c4..4ff96a36 100644 --- a/pkg/infra/models/admin_scim_group.go +++ b/pkg/infra/models/admin_scim_group.go @@ -1,48 +1,56 @@ +// Package models provides the data structures used in the admin package. package models +// SCIMGroupPathScheme represents the path scheme for a SCIM group. type SCIMGroupPathScheme struct { - Schemas []string `json:"schemas,omitempty"` - Operations []*SCIMGroupOperationScheme `json:"Operations,omitempty"` + Schemas []string `json:"schemas,omitempty"` // The schemas for the SCIM group. + Operations []*SCIMGroupOperationScheme `json:"Operations,omitempty"` // The operations for the SCIM group. } +// SCIMGroupOperationScheme represents the operation scheme for a SCIM group. type SCIMGroupOperationScheme struct { - Op string `json:"op,omitempty"` - Path string `json:"path,omitempty"` - Value []*SCIMGroupOperationValueScheme `json:"value,omitempty"` + Op string `json:"op,omitempty"` // The operation type. + Path string `json:"path,omitempty"` // The path for the operation. + Value []*SCIMGroupOperationValueScheme `json:"value,omitempty"` // The values for the operation. } +// SCIMGroupOperationValueScheme represents the value scheme for a SCIM group operation. type SCIMGroupOperationValueScheme struct { - Value string `json:"value,omitempty"` - Display string `json:"display,omitempty"` + Value string `json:"value,omitempty"` // The value for the operation. + Display string `json:"display,omitempty"` // The display for the operation. } +// ScimGroupPageScheme represents a page of SCIM groups. type ScimGroupPageScheme struct { - Schemas []string `json:"schemas,omitempty"` - TotalResults int `json:"totalResults,omitempty"` - StartIndex int `json:"startIndex,omitempty"` - ItemsPerPage int `json:"itemsPerPage,omitempty"` - Resources []*ScimGroupScheme `json:"Resources,omitempty"` + Schemas []string `json:"schemas,omitempty"` // The schemas for the SCIM groups. + TotalResults int `json:"totalResults,omitempty"` // The total number of SCIM groups. + StartIndex int `json:"startIndex,omitempty"` // The start index for the SCIM groups. + ItemsPerPage int `json:"itemsPerPage,omitempty"` // The number of SCIM groups per page. + Resources []*ScimGroupScheme `json:"Resources,omitempty"` // The SCIM groups on the page. } +// ScimGroupScheme represents a SCIM group. type ScimGroupScheme struct { - Schemas []string `json:"schemas,omitempty"` - ID string `json:"id,omitempty"` - ExternalID string `json:"externalId,omitempty"` - DisplayName string `json:"displayName,omitempty"` - Members []*ScimGroupMemberScheme `json:"members,omitempty"` - Meta *ScimMetadata `json:"meta,omitempty"` + Schemas []string `json:"schemas,omitempty"` // The schemas for the SCIM group. + ID string `json:"id,omitempty"` // The ID of the SCIM group. + ExternalID string `json:"externalId,omitempty"` // The external ID of the SCIM group. + DisplayName string `json:"displayName,omitempty"` // The display name of the SCIM group. + Members []*ScimGroupMemberScheme `json:"members,omitempty"` // The members of the SCIM group. + Meta *ScimMetadata `json:"meta,omitempty"` // The metadata for the SCIM group. } +// ScimGroupMemberScheme represents a member of a SCIM group. type ScimGroupMemberScheme struct { - Type string `json:"type,omitempty"` - Value string `json:"value,omitempty"` - Display string `json:"display,omitempty"` - Ref string `json:"$ref,omitempty"` + Type string `json:"type,omitempty"` // The type of the member. + Value string `json:"value,omitempty"` // The value of the member. + Display string `json:"display,omitempty"` // The display of the member. + Ref string `json:"$ref,omitempty"` // The reference of the member. } +// ScimMetadata represents the metadata for a SCIM group. type ScimMetadata struct { - ResourceType string `json:"resourceType,omitempty"` - Location string `json:"location,omitempty"` - LastModified string `json:"lastModified,omitempty"` - Created string `json:"created,omitempty"` + ResourceType string `json:"resourceType,omitempty"` // The resource type of the SCIM group. + Location string `json:"location,omitempty"` // The location of the SCIM group. + LastModified string `json:"lastModified,omitempty"` // The last modified time of the SCIM group. + Created string `json:"created,omitempty"` // The creation time of the SCIM group. } diff --git a/pkg/infra/models/admin_scim_scheme.go b/pkg/infra/models/admin_scim_scheme.go index 30ee42d1..bcc2c3d7 100644 --- a/pkg/infra/models/admin_scim_scheme.go +++ b/pkg/infra/models/admin_scim_scheme.go @@ -1,93 +1,101 @@ +// Package models provides the data structures used in the admin package. package models import "time" +// SCIMSchemasScheme represents a SCIM schema. type SCIMSchemasScheme struct { - TotalResults int `json:"totalResults,omitempty"` - ItemsPerPage int `json:"itemsPerPage,omitempty"` - StartIndex int `json:"startIndex,omitempty"` - Schemas []string `json:"schemas,omitempty"` - Resources []*ResourceScheme `json:"Resources,omitempty"` + TotalResults int `json:"totalResults,omitempty"` // The total number of results. + ItemsPerPage int `json:"itemsPerPage,omitempty"` // The number of items per page. + StartIndex int `json:"startIndex,omitempty"` // The start index of the results. + Schemas []string `json:"schemas,omitempty"` // The schemas. + Resources []*ResourceScheme `json:"Resources,omitempty"` // The resources. } +// ResourceScheme represents a resource. type ResourceScheme struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Description string `json:"description,omitempty"` - Attributes []*AttributeScheme `json:"attributes,omitempty"` - Meta *ResourceMetaScheme `json:"meta,omitempty"` + ID string `json:"id,omitempty"` // The ID of the resource. + Name string `json:"name,omitempty"` // The name of the resource. + Description string `json:"description,omitempty"` // The description of the resource. + Attributes []*AttributeScheme `json:"attributes,omitempty"` // The attributes of the resource. + Meta *ResourceMetaScheme `json:"meta,omitempty"` // The metadata of the resource. } +// ResourceMetaScheme represents the metadata of a resource. type ResourceMetaScheme struct { - ResourceType string `json:"resourceType,omitempty"` - Location string `json:"location,omitempty"` + ResourceType string `json:"resourceType,omitempty"` // The type of the resource. + Location string `json:"location,omitempty"` // The location of the resource. } +// AttributeScheme represents an attribute. type AttributeScheme struct { - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - MultiValued bool `json:"multiValued,omitempty"` - Description string `json:"description,omitempty"` - Required bool `json:"required,omitempty"` - CaseExact bool `json:"caseExact,omitempty"` - Mutability string `json:"mutability,omitempty"` - Returned string `json:"returned,omitempty"` - Uniqueness string `json:"uniqueness,omitempty"` - SubAttributes []*SubAttributeScheme `json:"subAttributes,omitempty"` + Name string `json:"name,omitempty"` // The name of the attribute. + Type string `json:"type,omitempty"` // The type of the attribute. + MultiValued bool `json:"multiValued,omitempty"` // Whether the attribute is multi-valued. + Description string `json:"description,omitempty"` // The description of the attribute. + Required bool `json:"required,omitempty"` // Whether the attribute is required. + CaseExact bool `json:"caseExact,omitempty"` // Whether the attribute is case exact. + Mutability string `json:"mutability,omitempty"` // The mutability of the attribute. + Returned string `json:"returned,omitempty"` // When the attribute is returned. + Uniqueness string `json:"uniqueness,omitempty"` // The uniqueness of the attribute. + SubAttributes []*SubAttributeScheme `json:"subAttributes,omitempty"` // The sub-attributes of the attribute. } +// SubAttributeScheme represents a sub-attribute. type SubAttributeScheme struct { - Name string `json:"name,omitempty"` - Type string `json:"type,omitempty"` - MultiValued bool `json:"multiValued,omitempty"` - Description string `json:"description,omitempty"` - Required bool `json:"required,omitempty"` - CaseExact bool `json:"caseExact,omitempty"` - Mutability string `json:"mutability,omitempty"` - Returned string `json:"returned,omitempty"` - Uniqueness string `json:"uniqueness,omitempty"` + Name string `json:"name,omitempty"` // The name of the sub-attribute. + Type string `json:"type,omitempty"` // The type of the sub-attribute. + MultiValued bool `json:"multiValued,omitempty"` // Whether the sub-attribute is multi-valued. + Description string `json:"description,omitempty"` // The description of the sub-attribute. + Required bool `json:"required,omitempty"` // Whether the sub-attribute is required. + CaseExact bool `json:"caseExact,omitempty"` // Whether the sub-attribute is case exact. + Mutability string `json:"mutability,omitempty"` // The mutability of the sub-attribute. + Returned string `json:"returned,omitempty"` // When the sub-attribute is returned. + Uniqueness string `json:"uniqueness,omitempty"` // The uniqueness of the sub-attribute. } +// SCIMSchemaScheme represents a SCIM schema. type SCIMSchemaScheme struct { - ID string `json:"id,omitempty"` - Name string `json:"name,omitempty"` - Description string `json:"description,omitempty"` - Attributes []*AttributeScheme `json:"attributes,omitempty"` - Meta *ResourceMetaScheme `json:"meta,omitempty"` + ID string `json:"id,omitempty"` // The ID of the schema. + Name string `json:"name,omitempty"` // The name of the schema. + Description string `json:"description,omitempty"` // The description of the schema. + Attributes []*AttributeScheme `json:"attributes,omitempty"` // The attributes of the schema. + Meta *ResourceMetaScheme `json:"meta,omitempty"` // The metadata of the schema. } +// ServiceProviderConfigScheme represents a service provider configuration. type ServiceProviderConfigScheme struct { - Schemas []string `json:"schemas"` + Schemas []string `json:"schemas"` // The schemas. Patch struct { - Supported bool `json:"supported"` + Supported bool `json:"supported"` // Whether patching is supported. } `json:"patch"` Bulk struct { - Supported bool `json:"supported"` - MaxOperations int `json:"maxOperations"` - MaxPayloadSize int `json:"maxPayloadSize"` + Supported bool `json:"supported"` // Whether bulk operations are supported. + MaxOperations int `json:"maxOperations"` // The maximum number of operations. + MaxPayloadSize int `json:"maxPayloadSize"` // The maximum payload size. } `json:"bulk"` Filter struct { - MaxResults int `json:"maxResults"` - Supported bool `json:"supported"` + MaxResults int `json:"maxResults"` // The maximum number of results. + Supported bool `json:"supported"` // Whether filtering is supported. } `json:"filter"` ChangePassword struct { - Supported bool `json:"supported"` + Supported bool `json:"supported"` // Whether password change is supported. } `json:"changePassword"` Sort struct { - Supported bool `json:"supported"` + Supported bool `json:"supported"` // Whether sorting is supported. } `json:"sort"` Etag struct { - Supported bool `json:"supported"` + Supported bool `json:"supported"` // Whether ETag is supported. } `json:"etag"` AuthenticationSchemes []struct { - Type string `json:"type"` - Name string `json:"name"` - Description string `json:"description"` + Type string `json:"type"` // The type of the authentication scheme. + Name string `json:"name"` // The name of the authentication scheme. + Description string `json:"description"` // The description of the authentication scheme. } `json:"authenticationSchemes"` Meta struct { - Location string `json:"location"` - ResourceType string `json:"resourceType"` - LastModified time.Time `json:"lastModified"` - Created time.Time `json:"created"` + Location string `json:"location"` // The location of the metadata. + ResourceType string `json:"resourceType"` // The type of the resource. + LastModified time.Time `json:"lastModified"` // The last modified time. + Created time.Time `json:"created"` // The creation time. } `json:"meta"` } diff --git a/pkg/infra/models/admin_scim_user.go b/pkg/infra/models/admin_scim_user.go index 3898e4b8..5fce5d0c 100644 --- a/pkg/infra/models/admin_scim_user.go +++ b/pkg/infra/models/admin_scim_user.go @@ -1,91 +1,103 @@ +// Package models provides the data structures used in the admin package. package models +// SCIMUserScheme represents a SCIM user. type SCIMUserScheme struct { - ID string `json:"id"` - ExternalID string `json:"externalId"` - Meta *SCIMUserMetaScheme `json:"meta,omitempty"` - Groups []*SCIMUserGroupScheme `json:"groups,omitempty"` - UserName string `json:"userName,omitempty"` - Emails []*SCIMUserEmailScheme `json:"emails,omitempty"` - Name *SCIMUserNameScheme `json:"name,omitempty"` - DisplayName string `json:"displayName,omitempty"` - NickName string `json:"nickName,omitempty"` - Title string `json:"title,omitempty"` - PreferredLanguage string `json:"preferredLanguage,omitempty"` - Department string `json:"department,omitempty"` - Organization string `json:"organization,omitempty"` - Timezone string `json:"timezone,omitempty"` - PhoneNumbers []*SCIMUserPhoneNumberScheme `json:"phoneNumbers,omitempty"` - Active bool `json:"active,omitempty"` - EnterpriseInfo *SCIMEnterpriseUserInfoScheme `json:"urn:ietf:params:scim:schemas:extension:enterprise:2.1:User,omitempty"` - SCIMExtension *SCIMExtensionScheme `json:"urn:scim:schemas:extension:atlassian-external:1.1,omitempty"` -} - + ID string `json:"id"` // The ID of the user. + ExternalID string `json:"externalId"` // The external ID of the user. + Meta *SCIMUserMetaScheme `json:"meta,omitempty"` // The metadata of the user. + Groups []*SCIMUserGroupScheme `json:"groups,omitempty"` // The groups the user belongs to. + UserName string `json:"userName,omitempty"` // The username of the user. + Emails []*SCIMUserEmailScheme `json:"emails,omitempty"` // The emails of the user. + Name *SCIMUserNameScheme `json:"name,omitempty"` // The name of the user. + DisplayName string `json:"displayName,omitempty"` // The display name of the user. + NickName string `json:"nickName,omitempty"` // The nickname of the user. + Title string `json:"title,omitempty"` // The title of the user. + PreferredLanguage string `json:"preferredLanguage,omitempty"` // The preferred language of the user. + Department string `json:"department,omitempty"` // The department of the user. + Organization string `json:"organization,omitempty"` // The organization of the user. + Timezone string `json:"timezone,omitempty"` // The timezone of the user. + PhoneNumbers []*SCIMUserPhoneNumberScheme `json:"phoneNumbers,omitempty"` // The phone numbers of the user. + Active bool `json:"active,omitempty"` // Whether the user is active. + EnterpriseInfo *SCIMEnterpriseUserInfoScheme `json:"urn:ietf:params:scim:schemas:extension:enterprise:2.1:User,omitempty"` // The enterprise user info of the user. + SCIMExtension *SCIMExtensionScheme `json:"urn:scim:schemas:extension:atlassian-external:1.1,omitempty"` // The SCIM extension of the user. +} + +// SCIMUserEmailScheme represents an email of a SCIM user. type SCIMUserEmailScheme struct { - Value string `json:"value,omitempty"` - Type string `json:"type,omitempty"` - Primary bool `json:"primary,omitempty"` + Value string `json:"value,omitempty"` // The value of the email. + Type string `json:"type,omitempty"` // The type of the email. + Primary bool `json:"primary,omitempty"` // Whether the email is primary. } +// SCIMUserNameScheme represents the name of a SCIM user. type SCIMUserNameScheme struct { - Formatted string `json:"formatted,omitempty"` - FamilyName string `json:"familyName,omitempty"` - GivenName string `json:"givenName,omitempty"` - MiddleName string `json:"middleName,omitempty"` - HonorificPrefix string `json:"honorificPrefix,omitempty"` - HonorificSuffix string `json:"honorificSuffix,omitempty"` + Formatted string `json:"formatted,omitempty"` // The formatted name. + FamilyName string `json:"familyName,omitempty"` // The family name. + GivenName string `json:"givenName,omitempty"` // The given name. + MiddleName string `json:"middleName,omitempty"` // The middle name. + HonorificPrefix string `json:"honorificPrefix,omitempty"` // The honorific prefix. + HonorificSuffix string `json:"honorificSuffix,omitempty"` // The honorific suffix. } +// SCIMUserPhoneNumberScheme represents a phone number of a SCIM user. type SCIMUserPhoneNumberScheme struct { - Value string `json:"value,omitempty"` - Type string `json:"type,omitempty"` - Primary bool `json:"primary,omitempty"` + Value string `json:"value,omitempty"` // The value of the phone number. + Type string `json:"type,omitempty"` // The type of the phone number. + Primary bool `json:"primary,omitempty"` // Whether the phone number is primary. } +// SCIMUserMetaScheme represents the metadata of a SCIM user. type SCIMUserMetaScheme struct { - ResourceType string `json:"resourceType,omitempty"` - Location string `json:"location,omitempty"` - LastModified string `json:"lastModified,omitempty"` - Created string `json:"created,omitempty"` + ResourceType string `json:"resourceType,omitempty"` // The resource type. + Location string `json:"location,omitempty"` // The location. + LastModified string `json:"lastModified,omitempty"` // The last modified time. + Created string `json:"created,omitempty"` // The creation time. } +// SCIMUserGroupScheme represents a group of a SCIM user. type SCIMUserGroupScheme struct { - Type string `json:"type,omitempty"` - Value string `json:"value,omitempty"` - Display string `json:"display,omitempty"` - Ref string `json:"$ref,omitempty"` + Type string `json:"type,omitempty"` // The type of the group. + Value string `json:"value,omitempty"` // The value of the group. + Display string `json:"display,omitempty"` // The display of the group. + Ref string `json:"$ref,omitempty"` // The reference of the group. } +// SCIMEnterpriseUserInfoScheme represents the enterprise user info of a SCIM user. type SCIMEnterpriseUserInfoScheme struct { - Organization string `json:"organization,omitempty"` - Department string `json:"department,omitempty"` + Organization string `json:"organization,omitempty"` // The organization. + Department string `json:"department,omitempty"` // The department. } +// SCIMExtensionScheme represents the SCIM extension of a SCIM user. type SCIMExtensionScheme struct { - AtlassianAccountID string `json:"atlassianAccountId,omitempty"` + AtlassianAccountID string `json:"atlassianAccountId,omitempty"` // The Atlassian account ID. } +// SCIMUserGetsOptionsScheme represents the options for getting SCIM users. type SCIMUserGetsOptionsScheme struct { - Attributes []string - ExcludedAttributes []string - Filter string + Attributes []string // The attributes to get. + ExcludedAttributes []string // The attributes to exclude. + Filter string // The filter. } +// SCIMUserPageScheme represents a page of SCIM users. type SCIMUserPageScheme struct { - Schemas []string `json:"schemas,omitempty"` - TotalResults int `json:"totalResults,omitempty"` - StartIndex int `json:"startIndex,omitempty"` - ItemsPerPage int `json:"itemsPerPage,omitempty"` - Resources []*SCIMUserScheme `json:"Resources,omitempty"` + Schemas []string `json:"schemas,omitempty"` // The schemas. + TotalResults int `json:"totalResults,omitempty"` // The total results. + StartIndex int `json:"startIndex,omitempty"` // The start index. + ItemsPerPage int `json:"itemsPerPage,omitempty"` // The items per page. + Resources []*SCIMUserScheme `json:"Resources,omitempty"` // The resources. } +// SCIMUserToPathScheme represents the path scheme for a SCIM user. type SCIMUserToPathScheme struct { - Schemas []string `json:"schemas,omitempty"` - Operations []*SCIMUserToPathOperationScheme `json:"operations,omitempty"` + Schemas []string `json:"schemas,omitempty"` // The schemas. + Operations []*SCIMUserToPathOperationScheme `json:"operations,omitempty"` // The operations. } +// AddStringOperation adds a string operation to the SCIM user path scheme. func (s *SCIMUserToPathScheme) AddStringOperation(operation, path, value string) error { - if operation == "" { return ErrNoSCIMOperationError } @@ -107,8 +119,8 @@ func (s *SCIMUserToPathScheme) AddStringOperation(operation, path, value string) return nil } +// AddBoolOperation adds a boolean operation to the SCIM user path scheme. func (s *SCIMUserToPathScheme) AddBoolOperation(operation, path string, value bool) error { - if operation == "" { return ErrNoSCIMOperationError } @@ -126,8 +138,8 @@ func (s *SCIMUserToPathScheme) AddBoolOperation(operation, path string, value bo return nil } +// AddComplexOperation adds a complex operation to the SCIM user path scheme. func (s *SCIMUserToPathScheme) AddComplexOperation(operation, path string, values []*SCIMUserComplexOperationScheme) error { - if operation == "" { return ErrNoSCIMOperationError } @@ -153,38 +165,41 @@ func (s *SCIMUserToPathScheme) AddComplexOperation(operation, path string, value return nil } +// SCIMUserComplexOperationScheme represents a complex operation of a SCIM user. type SCIMUserComplexOperationScheme struct { - Value string `json:"value,omitempty"` - ValueType string `json:"type,omitempty"` // Available values (work, home, other) - Primary bool `json:"primary,omitempty"` + Value string `json:"value,omitempty"` // The value of the operation. + ValueType string `json:"type,omitempty"` // Available values (work, home, other) + Primary bool `json:"primary,omitempty"` // Whether the operation is primary. } +// SCIMUserToPathValueScheme represents the value scheme for a path of a SCIM user. type SCIMUserToPathValueScheme struct { - Array bool `json:"array,omitempty"` - Null bool `json:"null,omitempty"` - ValueNode bool `json:"valueNode,omitempty"` - ContainerNode bool `json:"containerNode,omitempty"` - MissingNode bool `json:"missingNode,omitempty"` - Object bool `json:"object,omitempty"` - NodeType string `json:"nodeType,omitempty"` - Pojo bool `json:"pojo,omitempty"` - Number bool `json:"number,omitempty"` - IntegralNumber bool `json:"integralNumber,omitempty"` - FloatingPointNumber bool `json:"floatingPointNumber,omitempty"` - Short bool `json:"short,omitempty"` - Int bool `json:"int,omitempty"` - Long bool `json:"long,omitempty"` - Double bool `json:"double,omitempty"` - BigDecimal bool `json:"bigDecimal,omitempty"` - BigInteger bool `json:"bigInteger,omitempty"` - Textual bool `json:"textual,omitempty"` - Boolean bool `json:"boolean,omitempty"` - Binary bool `json:"binary,omitempty"` - Float bool `json:"float,omitempty"` -} - + Array bool `json:"array,omitempty"` // Whether the value is an array. + Null bool `json:"null,omitempty"` // Whether the value is null. + ValueNode bool `json:"valueNode,omitempty"` // Whether the value is a node. + ContainerNode bool `json:"containerNode,omitempty"` // Whether the value is a container node. + MissingNode bool `json:"missingNode,omitempty"` // Whether the value is a missing node. + Object bool `json:"object,omitempty"` // Whether the value is an object. + NodeType string `json:"nodeType,omitempty"` // The node type. + Pojo bool `json:"pojo,omitempty"` // Whether the value is a POJO. + Number bool `json:"number,omitempty"` // Whether the value is a number. + IntegralNumber bool `json:"integralNumber,omitempty"` // Whether the value is an integral number. + FloatingPointNumber bool `json:"floatingPointNumber,omitempty"` // Whether the value is a floating point number. + Short bool `json:"short,omitempty"` // Whether the value is short. + Int bool `json:"int,omitempty"` // Whether the value is an integer. + Long bool `json:"long,omitempty"` // Whether the value is long. + Double bool `json:"double,omitempty"` // Whether the value is double. + BigDecimal bool `json:"bigDecimal,omitempty"` // Whether the value is a big decimal. + BigInteger bool `json:"bigInteger,omitempty"` // Whether the value is a big integer. + Textual bool `json:"textual,omitempty"` // Whether the value is textual. + Boolean bool `json:"boolean,omitempty"` // Whether the value is boolean. + Binary bool `json:"binary,omitempty"` // Whether the value is binary. + Float bool `json:"float,omitempty"` // Whether the value is float. +} + +// SCIMUserToPathOperationScheme represents the operation scheme for a path of a SCIM user. type SCIMUserToPathOperationScheme struct { - Op string `json:"op,omitempty"` - Path string `json:"path,omitempty"` - Value interface{} `json:"value,omitempty"` + Op string `json:"op,omitempty"` // The operation. + Path string `json:"path,omitempty"` // The path. + Value interface{} `json:"value,omitempty"` // The value. } diff --git a/pkg/infra/models/admin_scim_user_test.go b/pkg/infra/models/admin_scim_user_test.go index 7cc5a0dc..e832fa2e 100644 --- a/pkg/infra/models/admin_scim_user_test.go +++ b/pkg/infra/models/admin_scim_user_test.go @@ -1,20 +1,25 @@ +// Package models provides the data structures used in the admin package. package models import ( - "github.com/stretchr/testify/assert" - "testing" + "github.com/stretchr/testify/assert" // Assert package for testing + "testing" // Standard Go testing package ) +// TestSCIMUserToPathScheme_AddStringOperation tests the AddStringOperation method of the SCIMUserToPathScheme struct. func TestSCIMUserToPathScheme_AddStringOperation(t *testing.T) { + // fields struct for holding the fields of SCIMUserToPathScheme type fields struct { Schemas []string Operations []*SCIMUserToPathOperationScheme } + // args struct for holding the arguments to the AddStringOperation method type args struct { operation string path string value string } + // testCases struct for holding each test case testCases := []struct { name string fields fields @@ -22,6 +27,7 @@ func TestSCIMUserToPathScheme_AddStringOperation(t *testing.T) { wantErr bool Err error }{ + // Test case when the parameters are correct { name: "when the parameters are correct", fields: fields{}, @@ -33,7 +39,7 @@ func TestSCIMUserToPathScheme_AddStringOperation(t *testing.T) { wantErr: false, Err: nil, }, - + // Test case when the operation is not provided { name: "when the operation is not provided", fields: fields{}, @@ -45,7 +51,7 @@ func TestSCIMUserToPathScheme_AddStringOperation(t *testing.T) { wantErr: true, Err: ErrNoSCIMOperationError, }, - + // Test case when the path is not provided { name: "when the path is not provided", fields: fields{}, @@ -57,7 +63,7 @@ func TestSCIMUserToPathScheme_AddStringOperation(t *testing.T) { wantErr: true, Err: ErrNoSCIMPathError, }, - + // Test case when the value is not provided { name: "when the value is not provided", fields: fields{}, @@ -70,38 +76,48 @@ func TestSCIMUserToPathScheme_AddStringOperation(t *testing.T) { Err: ErrNoSCIMValueError, }, } + // Loop over each test case for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { + // Create a new SCIMUserToPathScheme s := &SCIMUserToPathScheme{ Schemas: testCase.fields.Schemas, Operations: testCase.fields.Operations, } + // Call the AddStringOperation method err := s.AddStringOperation(testCase.args.operation, testCase.args.path, testCase.args.value) + // If an error is expected if testCase.wantErr { - + // Log the error if it exists if err != nil { t.Logf("error returned: %v", err.Error()) } + // Assert that the error is as expected assert.EqualError(t, err, testCase.Err.Error()) } else { + // Assert that no error occurred assert.NoError(t, err) } }) } } +// TestSCIMUserToPathScheme_AddBoolOperation tests the AddBoolOperation method of the SCIMUserToPathScheme struct. func TestSCIMUserToPathScheme_AddBoolOperation(t *testing.T) { + // fields struct for holding the fields of SCIMUserToPathScheme type fields struct { Schemas []string Operations []*SCIMUserToPathOperationScheme } + // args struct for holding the arguments to the AddBoolOperation method type args struct { operation string path string value bool } + // testCases struct for holding each test case testCases := []struct { name string fields fields @@ -109,6 +125,7 @@ func TestSCIMUserToPathScheme_AddBoolOperation(t *testing.T) { wantErr bool Err error }{ + // Test case when the parameters are correct { name: "when the parameters are correct", fields: fields{}, @@ -120,7 +137,7 @@ func TestSCIMUserToPathScheme_AddBoolOperation(t *testing.T) { wantErr: false, Err: nil, }, - + // Test case when the operation is not provided { name: "when the operation is not provided", fields: fields{}, @@ -132,7 +149,7 @@ func TestSCIMUserToPathScheme_AddBoolOperation(t *testing.T) { wantErr: true, Err: ErrNoSCIMOperationError, }, - + // Test case when the path is not provided { name: "when the path is not provided", fields: fields{}, @@ -145,38 +162,48 @@ func TestSCIMUserToPathScheme_AddBoolOperation(t *testing.T) { Err: ErrNoSCIMPathError, }, } + // Loop over each test case for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { + // Create a new SCIMUserToPathScheme s := &SCIMUserToPathScheme{ Schemas: testCase.fields.Schemas, Operations: testCase.fields.Operations, } + // Call the AddBoolOperation method err := s.AddBoolOperation(testCase.args.operation, testCase.args.path, testCase.args.value) + // If an error is expected if testCase.wantErr { - + // Log the error if it exists if err != nil { t.Logf("error returned: %v", err.Error()) } + // Assert that the error is as expected assert.EqualError(t, err, testCase.Err.Error()) } else { + // Assert that no error occurred assert.NoError(t, err) } }) } } +// TestSCIMUserToPathScheme_AddComplexOperation tests the AddComplexOperation method of the SCIMUserToPathScheme struct. func TestSCIMUserToPathScheme_AddComplexOperation(t *testing.T) { + // fields struct for holding the fields of SCIMUserToPathScheme type fields struct { Schemas []string Operations []*SCIMUserToPathOperationScheme } + // args struct for holding the arguments to the AddComplexOperation method type args struct { operation string path string values []*SCIMUserComplexOperationScheme } + // testCases struct for holding each test case testCases := []struct { name string fields fields @@ -184,6 +211,7 @@ func TestSCIMUserToPathScheme_AddComplexOperation(t *testing.T) { wantErr bool Err error }{ + // Test case when the parameters are correct { name: "when the parameters are correct", fields: fields{}, @@ -201,7 +229,7 @@ func TestSCIMUserToPathScheme_AddComplexOperation(t *testing.T) { wantErr: false, Err: nil, }, - + // Test case when the operation is not provided { name: "when the operation is not provided", fields: fields{}, @@ -212,7 +240,7 @@ func TestSCIMUserToPathScheme_AddComplexOperation(t *testing.T) { wantErr: true, Err: ErrNoSCIMOperationError, }, - + // Test case when the path is not provided { name: "when the path is not provided", fields: fields{}, @@ -223,7 +251,7 @@ func TestSCIMUserToPathScheme_AddComplexOperation(t *testing.T) { wantErr: true, Err: ErrNoSCIMPathError, }, - + // Test case when the value is not provided { name: "when the value is not provided", fields: fields{}, @@ -236,22 +264,28 @@ func TestSCIMUserToPathScheme_AddComplexOperation(t *testing.T) { Err: ErrNoSCIMComplexValueError, }, } + // Loop over each test case for _, testCase := range testCases { t.Run(testCase.name, func(t *testing.T) { + // Create a new SCIMUserToPathScheme s := &SCIMUserToPathScheme{ Schemas: testCase.fields.Schemas, Operations: testCase.fields.Operations, } + // Call the AddComplexOperation method err := s.AddComplexOperation(testCase.args.operation, testCase.args.path, testCase.args.values) + // If an error is expected if testCase.wantErr { - + // Log the error if it exists if err != nil { t.Logf("error returned: %v", err.Error()) } + // Assert that the error is as expected assert.EqualError(t, err, testCase.Err.Error()) } else { + // Assert that no error occurred assert.NoError(t, err) } }) diff --git a/pkg/infra/models/jira_comment_v3.go b/pkg/infra/models/jira_comment_v3.go index 5ad87129..e0a7a2a3 100644 --- a/pkg/infra/models/jira_comment_v3.go +++ b/pkg/infra/models/jira_comment_v3.go @@ -1,49 +1,57 @@ +// Package models provides the data structures used in the admin package. package models +// CommentNodeScheme represents a node in a comment. type CommentNodeScheme struct { - Version int `json:"version,omitempty"` - Type string `json:"type,omitempty"` - Content []*CommentNodeScheme `json:"content,omitempty"` - Text string `json:"text,omitempty"` - Attrs map[string]interface{} `json:"attrs,omitempty"` - Marks []*MarkScheme `json:"marks,omitempty"` + Version int `json:"version,omitempty"` // The version of the node. + Type string `json:"type,omitempty"` // The type of the node. + Content []*CommentNodeScheme `json:"content,omitempty"` // The content of the node. + Text string `json:"text,omitempty"` // The text of the node. + Attrs map[string]interface{} `json:"attrs,omitempty"` // The attributes of the node. + Marks []*MarkScheme `json:"marks,omitempty"` // The marks of the node. } +// AppendNode appends a node to the content of the CommentNodeScheme. func (n *CommentNodeScheme) AppendNode(node *CommentNodeScheme) { n.Content = append(n.Content, node) } +// MarkScheme represents a mark in a comment. type MarkScheme struct { - Type string `json:"type,omitempty"` - Attrs map[string]interface{} `json:"attrs,omitempty"` + Type string `json:"type,omitempty"` // The type of the mark. + Attrs map[string]interface{} `json:"attrs,omitempty"` // The attributes of the mark. } +// CommentPayloadScheme represents the payload of a comment. type CommentPayloadScheme struct { - Visibility *CommentVisibilityScheme `json:"visibility,omitempty"` - Body *CommentNodeScheme `json:"body,omitempty"` + Visibility *CommentVisibilityScheme `json:"visibility,omitempty"` // The visibility of the comment. + Body *CommentNodeScheme `json:"body,omitempty"` // The body of the comment. } +// IssueCommentPageScheme represents a page of issue comments. type IssueCommentPageScheme struct { - StartAt int `json:"startAt,omitempty"` - MaxResults int `json:"maxResults,omitempty"` - Total int `json:"total,omitempty"` - Comments []*IssueCommentScheme `json:"comments,omitempty"` + StartAt int `json:"startAt,omitempty"` // The start index of the comments. + MaxResults int `json:"maxResults,omitempty"` // The maximum number of comments per page. + Total int `json:"total,omitempty"` // The total number of comments. + Comments []*IssueCommentScheme `json:"comments,omitempty"` // The comments on the page. } +// IssueCommentScheme represents a comment on an issue. type IssueCommentScheme struct { - Self string `json:"self,omitempty"` - ID string `json:"id,omitempty"` - Author *UserScheme `json:"author,omitempty"` - RenderedBody string `json:"renderedBody,omitempty"` - Body *CommentNodeScheme `json:"body,omitempty"` - JSDPublic bool `json:"jsdPublic,omitempty"` - UpdateAuthor *UserScheme `json:"updateAuthor,omitempty"` - Created string `json:"created,omitempty"` - Updated string `json:"updated,omitempty"` - Visibility *CommentVisibilityScheme `json:"visibility,omitempty"` + Self string `json:"self,omitempty"` // The self link of the comment. + ID string `json:"id,omitempty"` // The ID of the comment. + Author *UserScheme `json:"author,omitempty"` // The author of the comment. + RenderedBody string `json:"renderedBody,omitempty"` // The rendered body of the comment. + Body *CommentNodeScheme `json:"body,omitempty"` // The body of the comment. + JSDPublic bool `json:"jsdPublic,omitempty"` // Whether the comment is public. + UpdateAuthor *UserScheme `json:"updateAuthor,omitempty"` // The author of the last update. + Created string `json:"created,omitempty"` // The creation time of the comment. + Updated string `json:"updated,omitempty"` // The last update time of the comment. + Visibility *CommentVisibilityScheme `json:"visibility,omitempty"` // The visibility of the comment. } +// CommentVisibilityScheme represents the visibility of a comment. type CommentVisibilityScheme struct { - Type string `json:"type,omitempty"` - Value string `json:"value,omitempty"` + Type string `json:"type,omitempty"` // The type of the visibility. + Value string `json:"value,omitempty"` // The value of the visibility. } diff --git a/pkg/infra/models/jira_customFields.go b/pkg/infra/models/jira_customFields.go index 83cd5c5a..15571d99 100644 --- a/pkg/infra/models/jira_customFields.go +++ b/pkg/infra/models/jira_customFields.go @@ -1,11 +1,14 @@ +// Package models provides the data structures used in the admin package. package models import ( "time" ) +// CustomFields represents a collection of custom fields. type CustomFields struct{ Fields []map[string]interface{} } +// Groups adds a group custom field to the collection. func (c *CustomFields) Groups(customFieldID string, groups []string) error { if len(customFieldID) == 0 { @@ -35,6 +38,7 @@ func (c *CustomFields) Groups(customFieldID string, groups []string) error { return nil } +// Group adds a single group custom field to the collection. func (c *CustomFields) Group(customFieldID, group string) error { if len(customFieldID) == 0 { @@ -58,6 +62,7 @@ func (c *CustomFields) Group(customFieldID, group string) error { return nil } +// URL adds a URL custom field to the collection. func (c *CustomFields) URL(customFieldID, URL string) error { if len(customFieldID) == 0 { @@ -78,6 +83,7 @@ func (c *CustomFields) URL(customFieldID, URL string) error { return nil } +// Text adds a text custom field to the collection. func (c *CustomFields) Text(customFieldID, textValue string) error { if len(customFieldID) == 0 { @@ -98,6 +104,7 @@ func (c *CustomFields) Text(customFieldID, textValue string) error { return nil } +// DateTime adds a datetime custom field to the collection. func (c *CustomFields) DateTime(customFieldID string, dateValue time.Time) error { if len(customFieldID) == 0 { @@ -118,6 +125,7 @@ func (c *CustomFields) DateTime(customFieldID string, dateValue time.Time) error return nil } +// Date adds a date custom field to the collection. func (c *CustomFields) Date(customFieldID string, dateTimeValue time.Time) (err error) { if len(customFieldID) == 0 { @@ -138,6 +146,7 @@ func (c *CustomFields) Date(customFieldID string, dateTimeValue time.Time) (err return } +// MultiSelect adds a multi-select custom field to the collection. func (c *CustomFields) MultiSelect(customFieldID string, options []string) error { if len(customFieldID) == 0 { @@ -167,6 +176,7 @@ func (c *CustomFields) MultiSelect(customFieldID string, options []string) error return nil } +// Select adds a select custom field to the collection. func (c *CustomFields) Select(customFieldID string, option string) error { if len(customFieldID) == 0 { @@ -190,6 +200,7 @@ func (c *CustomFields) Select(customFieldID string, option string) error { return nil } +// RadioButton adds a radio button custom field to the collection. func (c *CustomFields) RadioButton(customFieldID, button string) error { if len(customFieldID) == 0 { @@ -213,6 +224,7 @@ func (c *CustomFields) RadioButton(customFieldID, button string) error { return nil } +// User adds a user custom field to the collection. func (c *CustomFields) User(customFieldID string, accountID string) error { if len(customFieldID) == 0 { @@ -236,6 +248,7 @@ func (c *CustomFields) User(customFieldID string, accountID string) error { return nil } +// Users adds a multi-user custom field to the collection. func (c *CustomFields) Users(customFieldID string, accountIDs []string) error { if len(customFieldID) == 0 { @@ -265,6 +278,7 @@ func (c *CustomFields) Users(customFieldID string, accountIDs []string) error { return nil } +// Number adds a number custom field to the collection. func (c *CustomFields) Number(customFieldID string, numberValue float64) error { if len(customFieldID) == 0 { @@ -281,6 +295,7 @@ func (c *CustomFields) Number(customFieldID string, numberValue float64) error { return nil } +// CheckBox adds a checkbox custom field to the collection. func (c *CustomFields) CheckBox(customFieldID string, options []string) error { if len(customFieldID) == 0 { @@ -310,6 +325,7 @@ func (c *CustomFields) CheckBox(customFieldID string, options []string) error { return nil } +// Cascading adds a cascading custom field to the collection. func (c *CustomFields) Cascading(customFieldID, parent, child string) error { if len(customFieldID) == 0 {