1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2025-12-03 22:39:24 +02:00

feat: Add ResolutionService to retrieve resolutions

This commit is contained in:
Thibaut Rousseau
2018-06-25 17:48:53 +02:00
parent 98a84a4c00
commit fb1ce22699
6 changed files with 212 additions and 9 deletions

32
resolution_test.go Normal file
View File

@@ -0,0 +1,32 @@
package jira
import (
"fmt"
"io/ioutil"
"net/http"
"testing"
)
func TestResolutionService_GetList(t *testing.T) {
setup()
defer teardown()
testAPIEdpoint := "/rest/api/2/resolution"
raw, err := ioutil.ReadFile("./mocks/all_resolutions.json")
if err != nil {
t.Error(err.Error())
}
testMux.HandleFunc(testAPIEdpoint, func(w http.ResponseWriter, r *http.Request) {
testMethod(t, r, "GET")
testRequestURL(t, r, testAPIEdpoint)
fmt.Fprint(w, string(raw))
})
resolution, _, err := testClient.Resolution.GetList()
if resolution == nil {
t.Error("Expected resolution list. Resolution list is nil")
}
if err != nil {
t.Errorf("Error given: %s", err)
}
}