1
0
mirror of https://github.com/interviewstreet/go-jira.git synced 2024-12-10 10:10:10 +02:00
go-jira/resolution_test.go
2018-06-25 17:48:53 +02:00

33 lines
679 B
Go

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)
}
}