Skip to content

Commit

Permalink
Merge pull request #264 from ctreminiom/bug/test-cases-fix
Browse files Browse the repository at this point in the history
Fixed the test cases after dependencies upgrade.
  • Loading branch information
ctreminiom authored Jun 16, 2024
2 parents 00e8abd + 3726c3e commit 315fd26
Show file tree
Hide file tree
Showing 117 changed files with 2,085 additions and 1,957 deletions.
4 changes: 2 additions & 2 deletions admin/api_client_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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_: "",
Expand All @@ -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")),
Expand Down
32 changes: 16 additions & 16 deletions admin/internal/organization_directory_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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",
},
Expand Down Expand Up @@ -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",
},
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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",
},
Expand Down Expand Up @@ -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",
},
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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",
},
Expand Down Expand Up @@ -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",
},
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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",
},
Expand Down
48 changes: 24 additions & 24 deletions admin/internal/organization_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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,
Expand All @@ -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) {
Expand Down Expand Up @@ -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",
},
Expand Down Expand Up @@ -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,
Expand All @@ -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",
},
Expand Down Expand Up @@ -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",
},
Expand Down Expand Up @@ -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,
Expand All @@ -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",
},
Expand Down Expand Up @@ -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",
},
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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",
},
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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,
Expand All @@ -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",
Expand Down Expand Up @@ -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",
},
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand All @@ -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",
},
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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) {
Expand Down
Loading

0 comments on commit 315fd26

Please sign in to comment.