mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-11-29 22:28:34 +02:00
Cleaning a bunch of go vet issues
This commit is contained in:
@@ -112,11 +112,11 @@ func TestIssueService_UpdateIssue(t *testing.T) {
|
||||
|
||||
w.WriteHeader(http.StatusNoContent)
|
||||
})
|
||||
jId := "PROJ-9001"
|
||||
jID := "PROJ-9001"
|
||||
i := make(map[string]interface{})
|
||||
fields := make(map[string]interface{})
|
||||
i["fields"] = fields
|
||||
resp, err := testClient.Issue.UpdateIssue(jId, i)
|
||||
resp, err := testClient.Issue.UpdateIssue(jID, i)
|
||||
if resp == nil {
|
||||
t.Error("Expected resp. resp is nil")
|
||||
}
|
||||
@@ -182,25 +182,25 @@ func TestIssueService_UpdateComment(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestIssueService_AddWorklogRecord(t *testing.T) {
|
||||
setup()
|
||||
defer teardown()
|
||||
testMux.HandleFunc("/rest/api/2/issue/10000/worklog", func(w http.ResponseWriter, r *http.Request) {
|
||||
testMethod(t, r, "POST")
|
||||
testRequestURL(t, r, "/rest/api/2/issue/10000/worklog")
|
||||
setup()
|
||||
defer teardown()
|
||||
testMux.HandleFunc("/rest/api/2/issue/10000/worklog", func(w http.ResponseWriter, r *http.Request) {
|
||||
testMethod(t, r, "POST")
|
||||
testRequestURL(t, r, "/rest/api/2/issue/10000/worklog")
|
||||
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
fmt.Fprint(w, `{"self":"http://www.example.com/jira/rest/api/2/issue/10010/worklog/10000","author":{"self":"http://www.example.com/jira/rest/api/2/user?username=fred","name":"fred","displayName":"Fred F. User","active":false},"updateAuthor":{"self":"http://www.example.com/jira/rest/api/2/user?username=fred","name":"fred","displayName":"Fred F. User","active":false},"comment":"I did some work here.","updated":"2018-02-14T22:14:46.003+0000","visibility":{"type":"group","value":"jira-developers"},"started":"2018-02-14T22:14:46.003+0000","timeSpent":"3h 20m","timeSpentSeconds":12000,"id":"100028","issueId":"10002"}`)
|
||||
})
|
||||
r := &WorklogRecord{
|
||||
TimeSpent: "1h",
|
||||
}
|
||||
record, _, err := testClient.Issue.AddWorklogRecord("10000", r)
|
||||
if record == nil {
|
||||
t.Error("Expected Record. Record is nil")
|
||||
}
|
||||
if err != nil {
|
||||
t.Errorf("Error given: %s", err)
|
||||
}
|
||||
w.WriteHeader(http.StatusCreated)
|
||||
fmt.Fprint(w, `{"self":"http://www.example.com/jira/rest/api/2/issue/10010/worklog/10000","author":{"self":"http://www.example.com/jira/rest/api/2/user?username=fred","name":"fred","displayName":"Fred F. User","active":false},"updateAuthor":{"self":"http://www.example.com/jira/rest/api/2/user?username=fred","name":"fred","displayName":"Fred F. User","active":false},"comment":"I did some work here.","updated":"2018-02-14T22:14:46.003+0000","visibility":{"type":"group","value":"jira-developers"},"started":"2018-02-14T22:14:46.003+0000","timeSpent":"3h 20m","timeSpentSeconds":12000,"id":"100028","issueId":"10002"}`)
|
||||
})
|
||||
r := &WorklogRecord{
|
||||
TimeSpent: "1h",
|
||||
}
|
||||
record, _, err := testClient.Issue.AddWorklogRecord("10000", r)
|
||||
if record == nil {
|
||||
t.Error("Expected Record. Record is nil")
|
||||
}
|
||||
if err != nil {
|
||||
t.Errorf("Error given: %s", err)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIssueService_AddLink(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user