-
-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GroupService:
GroupService.Get
removed, `GroupService.GetWithOption…
…s` renamed Related #294
- Loading branch information
1 parent
33e2fcb
commit 295e4c7
Showing
5 changed files
with
45 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,21 +7,6 @@ import ( | |
"testing" | ||
) | ||
|
||
func TestGroupService_Get(t *testing.T) { | ||
setup() | ||
defer teardown() | ||
testMux.HandleFunc("/rest/api/2/group/member", func(w http.ResponseWriter, r *http.Request) { | ||
testMethod(t, r, http.MethodGet) | ||
testRequestURL(t, r, "/rest/api/2/group/member?groupname=default") | ||
fmt.Fprint(w, `{"self":"http://www.example.com/jira/rest/api/2/group/member?includeInactiveUsers=false&maxResults=50&groupname=default&startAt=0","maxResults":50,"startAt":0,"total":2,"isLast":true,"values":[{"self":"http://www.example.com/jira/rest/api/2/user?username=michael","name":"michael","key":"michael","emailAddress":"[email protected]","displayName":"MichaelScofield","active":true,"timeZone":"Australia/Sydney"},{"self":"http://www.example.com/jira/rest/api/2/user?username=alex","name":"alex","key":"alex","emailAddress":"[email protected]","displayName":"AlexanderMahone","active":true,"timeZone":"Australia/Sydney"}]}`) | ||
}) | ||
if members, _, err := testClient.Group.Get(context.Background(), "default"); err != nil { | ||
t.Errorf("Error given: %s", err) | ||
} else if members == nil { | ||
t.Error("Expected members. Group.Members is nil") | ||
} | ||
} | ||
|
||
func TestGroupService_GetPage(t *testing.T) { | ||
setup() | ||
defer teardown() | ||
|
@@ -37,7 +22,7 @@ func TestGroupService_GetPage(t *testing.T) { | |
t.Errorf("startAt %s", startAt) | ||
} | ||
}) | ||
if page, resp, err := testClient.Group.GetWithOptions(context.Background(), "default", &GroupSearchOptions{ | ||
if page, resp, err := testClient.Group.Get(context.Background(), "default", &GroupSearchOptions{ | ||
StartAt: 0, | ||
MaxResults: 2, | ||
IncludeInactiveUsers: false, | ||
|
@@ -55,7 +40,7 @@ func TestGroupService_GetPage(t *testing.T) { | |
if resp.Total != 4 { | ||
t.Errorf("Expect Result Total to be 4, but is %d", resp.Total) | ||
} | ||
if page, resp, err := testClient.Group.GetWithOptions(context.Background(), "default", &GroupSearchOptions{ | ||
if page, resp, err := testClient.Group.Get(context.Background(), "default", &GroupSearchOptions{ | ||
StartAt: 2, | ||
MaxResults: 2, | ||
IncludeInactiveUsers: false, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,21 +7,6 @@ import ( | |
"testing" | ||
) | ||
|
||
func TestGroupService_Get(t *testing.T) { | ||
setup() | ||
defer teardown() | ||
testMux.HandleFunc("/rest/api/2/group/member", func(w http.ResponseWriter, r *http.Request) { | ||
testMethod(t, r, http.MethodGet) | ||
testRequestURL(t, r, "/rest/api/2/group/member?groupname=default") | ||
fmt.Fprint(w, `{"self":"http://www.example.com/jira/rest/api/2/group/member?includeInactiveUsers=false&maxResults=50&groupname=default&startAt=0","maxResults":50,"startAt":0,"total":2,"isLast":true,"values":[{"self":"http://www.example.com/jira/rest/api/2/user?username=michael","name":"michael","key":"michael","emailAddress":"[email protected]","displayName":"MichaelScofield","active":true,"timeZone":"Australia/Sydney"},{"self":"http://www.example.com/jira/rest/api/2/user?username=alex","name":"alex","key":"alex","emailAddress":"[email protected]","displayName":"AlexanderMahone","active":true,"timeZone":"Australia/Sydney"}]}`) | ||
}) | ||
if members, _, err := testClient.Group.Get(context.Background(), "default"); err != nil { | ||
t.Errorf("Error given: %s", err) | ||
} else if members == nil { | ||
t.Error("Expected members. Group.Members is nil") | ||
} | ||
} | ||
|
||
func TestGroupService_GetPage(t *testing.T) { | ||
setup() | ||
defer teardown() | ||
|
@@ -37,7 +22,7 @@ func TestGroupService_GetPage(t *testing.T) { | |
t.Errorf("startAt %s", startAt) | ||
} | ||
}) | ||
if page, resp, err := testClient.Group.GetWithOptions(context.Background(), "default", &GroupSearchOptions{ | ||
if page, resp, err := testClient.Group.Get(context.Background(), "default", &GroupSearchOptions{ | ||
StartAt: 0, | ||
MaxResults: 2, | ||
IncludeInactiveUsers: false, | ||
|
@@ -55,7 +40,7 @@ func TestGroupService_GetPage(t *testing.T) { | |
if resp.Total != 4 { | ||
t.Errorf("Expect Result Total to be 4, but is %d", resp.Total) | ||
} | ||
if page, resp, err := testClient.Group.GetWithOptions(context.Background(), "default", &GroupSearchOptions{ | ||
if page, resp, err := testClient.Group.Get(context.Background(), "default", &GroupSearchOptions{ | ||
StartAt: 2, | ||
MaxResults: 2, | ||
IncludeInactiveUsers: false, | ||
|