@@ -620,9 +620,9 @@ func TestIssueService_DeleteLink(t *testing.T) {
620620func TestIssueService_Search (t * testing.T ) {
621621 setup ()
622622 defer teardown ()
623- testMux .HandleFunc ("/rest/api/2 /search" , func (w http.ResponseWriter , r * http.Request ) {
623+ testMux .HandleFunc ("/rest/api/3 /search/jql " , func (w http.ResponseWriter , r * http.Request ) {
624624 testMethod (t , r , http .MethodGet )
625- testRequestURL (t , r , "/rest/api/2 /search?expand=foo&jql=type+%3D+Bug+and+Status+NOT+IN+%28Resolved%29&maxResults=40&startAt=1" )
625+ testRequestURL (t , r , "/rest/api/3 /search/jql ?expand=foo&jql=type+%3D+Bug+and+Status+NOT+IN+%28Resolved%29&maxResults=40&startAt=1" )
626626 w .WriteHeader (http .StatusOK )
627627 fmt .Fprint (w , `{"expand": "schema,names","startAt": 1,"maxResults": 40,"total": 6,"issues": [{"expand": "html","id": "10230","self": "http://kelpie9:8081/rest/api/2/issue/BULK-62","key": "BULK-62","fields": {"summary": "testing","timetracking": null,"issuetype": {"self": "http://kelpie9:8081/rest/api/2/issuetype/5","id": "5","description": "The sub-task of the issue","iconUrl": "http://kelpie9:8081/images/icons/issue_subtask.gif","name": "Sub-task","subtask": true},"customfield_10071": null}},{"expand": "html","id": "10004","self": "http://kelpie9:8081/rest/api/2/issue/BULK-47","key": "BULK-47","fields": {"summary": "Cheese v1 2.0 issue","timetracking": null,"issuetype": {"self": "http://kelpie9:8081/rest/api/2/issuetype/3","id": "3","description": "A task that needs to be done.","iconUrl": "http://kelpie9:8081/images/icons/task.gif","name": "Task","subtask": false}}}]}` )
628628 })
@@ -651,9 +651,9 @@ func TestIssueService_Search(t *testing.T) {
651651func TestIssueService_SearchEmptyJQL (t * testing.T ) {
652652 setup ()
653653 defer teardown ()
654- testMux .HandleFunc ("/rest/api/2 /search" , func (w http.ResponseWriter , r * http.Request ) {
654+ testMux .HandleFunc ("/rest/api/3 /search/jql " , func (w http.ResponseWriter , r * http.Request ) {
655655 testMethod (t , r , http .MethodGet )
656- testRequestURL (t , r , "/rest/api/2 /search?expand=foo&maxResults=40&startAt=1" )
656+ testRequestURL (t , r , "/rest/api/3 /search/jql ?expand=foo&maxResults=40&startAt=1" )
657657 w .WriteHeader (http .StatusOK )
658658 fmt .Fprint (w , `{"expand": "schema,names","startAt": 1,"maxResults": 40,"total": 6,"issues": [{"expand": "html","id": "10230","self": "http://kelpie9:8081/rest/api/2/issue/BULK-62","key": "BULK-62","fields": {"summary": "testing","timetracking": null,"issuetype": {"self": "http://kelpie9:8081/rest/api/2/issuetype/5","id": "5","description": "The sub-task of the issue","iconUrl": "http://kelpie9:8081/images/icons/issue_subtask.gif","name": "Sub-task","subtask": true},"customfield_10071": null}},{"expand": "html","id": "10004","self": "http://kelpie9:8081/rest/api/2/issue/BULK-47","key": "BULK-47","fields": {"summary": "Cheese v1 2.0 issue","timetracking": null,"issuetype": {"self": "http://kelpie9:8081/rest/api/2/issuetype/3","id": "3","description": "A task that needs to be done.","iconUrl": "http://kelpie9:8081/images/icons/task.gif","name": "Task","subtask": false}}}]}` )
659659 })
@@ -682,9 +682,9 @@ func TestIssueService_SearchEmptyJQL(t *testing.T) {
682682func TestIssueService_Search_WithoutPaging (t * testing.T ) {
683683 setup ()
684684 defer teardown ()
685- testMux .HandleFunc ("/rest/api/2 /search" , func (w http.ResponseWriter , r * http.Request ) {
685+ testMux .HandleFunc ("/rest/api/3 /search/jql " , func (w http.ResponseWriter , r * http.Request ) {
686686 testMethod (t , r , http .MethodGet )
687- testRequestURL (t , r , "/rest/api/2 /search?jql=something" )
687+ testRequestURL (t , r , "/rest/api/3 /search/jql ?jql=something" )
688688 w .WriteHeader (http .StatusOK )
689689 fmt .Fprint (w , `{"expand": "schema,names","startAt": 0,"maxResults": 50,"total": 6,"issues": [{"expand": "html","id": "10230","self": "http://kelpie9:8081/rest/api/2/issue/BULK-62","key": "BULK-62","fields": {"summary": "testing","timetracking": null,"issuetype": {"self": "http://kelpie9:8081/rest/api/2/issuetype/5","id": "5","description": "The sub-task of the issue","iconUrl": "http://kelpie9:8081/images/icons/issue_subtask.gif","name": "Sub-task","subtask": true},"customfield_10071": null}},{"expand": "html","id": "10004","self": "http://kelpie9:8081/rest/api/2/issue/BULK-47","key": "BULK-47","fields": {"summary": "Cheese v1 2.0 issue","timetracking": null,"issuetype": {"self": "http://kelpie9:8081/rest/api/2/issuetype/3","id": "3","description": "A task that needs to be done.","iconUrl": "http://kelpie9:8081/images/icons/task.gif","name": "Task","subtask": false}}}]}` )
690690 })
@@ -711,17 +711,17 @@ func TestIssueService_Search_WithoutPaging(t *testing.T) {
711711func TestIssueService_SearchPages (t * testing.T ) {
712712 setup ()
713713 defer teardown ()
714- testMux .HandleFunc ("/rest/api/2 /search" , func (w http.ResponseWriter , r * http.Request ) {
714+ testMux .HandleFunc ("/rest/api/3 /search/jql " , func (w http.ResponseWriter , r * http.Request ) {
715715 testMethod (t , r , http .MethodGet )
716- if r .URL .String () == "/rest/api/2 /search?expand=foo&jql=something&maxResults=2&startAt=1&validateQuery=warn" {
716+ if r .URL .String () == "/rest/api/3 /search/jql ?expand=foo&jql=something&maxResults=2&startAt=1&validateQuery=warn" {
717717 w .WriteHeader (http .StatusOK )
718718 fmt .Fprint (w , `{"expand": "schema,names","startAt": 1,"maxResults": 2,"total": 6,"issues": [{"expand": "html","id": "10230","self": "http://kelpie9:8081/rest/api/2/issue/BULK-62","key": "BULK-62","fields": {"summary": "testing","timetracking": null,"issuetype": {"self": "http://kelpie9:8081/rest/api/2/issuetype/5","id": "5","description": "The sub-task of the issue","iconUrl": "http://kelpie9:8081/images/icons/issue_subtask.gif","name": "Sub-task","subtask": true},"customfield_10071": null}},{"expand": "html","id": "10004","self": "http://kelpie9:8081/rest/api/2/issue/BULK-47","key": "BULK-47","fields": {"summary": "Cheese v1 2.0 issue","timetracking": null,"issuetype": {"self": "http://kelpie9:8081/rest/api/2/issuetype/3","id": "3","description": "A task that needs to be done.","iconUrl": "http://kelpie9:8081/images/icons/task.gif","name": "Task","subtask": false}}}]}` )
719719 return
720- } else if r .URL .String () == "/rest/api/2 /search?expand=foo&jql=something&maxResults=2&startAt=3&validateQuery=warn" {
720+ } else if r .URL .String () == "/rest/api/3 /search/jql ?expand=foo&jql=something&maxResults=2&startAt=3&validateQuery=warn" {
721721 w .WriteHeader (http .StatusOK )
722722 fmt .Fprint (w , `{"expand": "schema,names","startAt": 3,"maxResults": 2,"total": 6,"issues": [{"expand": "html","id": "10230","self": "http://kelpie9:8081/rest/api/2/issue/BULK-62","key": "BULK-62","fields": {"summary": "testing","timetracking": null,"issuetype": {"self": "http://kelpie9:8081/rest/api/2/issuetype/5","id": "5","description": "The sub-task of the issue","iconUrl": "http://kelpie9:8081/images/icons/issue_subtask.gif","name": "Sub-task","subtask": true},"customfield_10071": null}},{"expand": "html","id": "10004","self": "http://kelpie9:8081/rest/api/2/issue/BULK-47","key": "BULK-47","fields": {"summary": "Cheese v1 2.0 issue","timetracking": null,"issuetype": {"self": "http://kelpie9:8081/rest/api/2/issuetype/3","id": "3","description": "A task that needs to be done.","iconUrl": "http://kelpie9:8081/images/icons/task.gif","name": "Task","subtask": false}}}]}` )
723723 return
724- } else if r .URL .String () == "/rest/api/2 /search?expand=foo&jql=something&maxResults=2&startAt=5&validateQuery=warn" {
724+ } else if r .URL .String () == "/rest/api/3 /search/jql ?expand=foo&jql=something&maxResults=2&startAt=5&validateQuery=warn" {
725725 w .WriteHeader (http .StatusOK )
726726 fmt .Fprint (w , `{"expand": "schema,names","startAt": 5,"maxResults": 2,"total": 6,"issues": [{"expand": "html","id": "10230","self": "http://kelpie9:8081/rest/api/2/issue/BULK-62","key": "BULK-62","fields": {"summary": "testing","timetracking": null,"issuetype": {"self": "http://kelpie9:8081/rest/api/2/issuetype/5","id": "5","description": "The sub-task of the issue","iconUrl": "http://kelpie9:8081/images/icons/issue_subtask.gif","name": "Sub-task","subtask": true},"customfield_10071": null}}]}` )
727727 return
@@ -749,9 +749,9 @@ func TestIssueService_SearchPages(t *testing.T) {
749749func TestIssueService_SearchPages_EmptyResult (t * testing.T ) {
750750 setup ()
751751 defer teardown ()
752- testMux .HandleFunc ("/rest/api/2 /search" , func (w http.ResponseWriter , r * http.Request ) {
752+ testMux .HandleFunc ("/rest/api/3 /search/jql " , func (w http.ResponseWriter , r * http.Request ) {
753753 testMethod (t , r , http .MethodGet )
754- if r .URL .String () == "/rest/api/2 /search?expand=foo&jql=something&maxResults=50&startAt=1&validateQuery=warn" {
754+ if r .URL .String () == "/rest/api/3 /search/jql ?expand=foo&jql=something&maxResults=50&startAt=1&validateQuery=warn" {
755755 w .WriteHeader (http .StatusOK )
756756 // This is what Jira outputs when the &maxResult= issue occurs. It used to cause SearchPages to go into an endless loop.
757757 fmt .Fprint (w , `{"expand": "schema,names","startAt": 0,"maxResults": 0,"total": 6,"issues": []}` )
0 commit comments