mirror of
https://github.com/interviewstreet/go-jira.git
synced 2025-07-15 01:04:38 +02:00
Renamed "json_mocks" into "mocks"
This commit is contained in:
@ -66,14 +66,12 @@ type ProjectComponent struct {
|
|||||||
ProjectID int `json:"projectId"`
|
ProjectID int `json:"projectId"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get all projects form jira
|
// GetList gets all projects form JIRA
|
||||||
//
|
//
|
||||||
// JIRA API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/project-getAllProjects
|
// JIRA API docs: https://docs.atlassian.com/jira/REST/latest/#api/2/project-getAllProjects
|
||||||
func (s *ProjectService) GetList() (*ProjectList, *http.Response, error) {
|
func (s *ProjectService) GetList() (*ProjectList, *http.Response, error) {
|
||||||
|
|
||||||
apiEndpoint := "rest/api/2/project"
|
apiEndpoint := "rest/api/2/project"
|
||||||
req, err := s.client.NewRequest("GET", apiEndpoint, nil)
|
req, err := s.client.NewRequest("GET", apiEndpoint, nil)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
@ -94,7 +92,6 @@ func (s *ProjectService) GetList() (*ProjectList, *http.Response, error) {
|
|||||||
func (s *ProjectService) Get(projectID string) (*FullProject, *http.Response, error) {
|
func (s *ProjectService) Get(projectID string) (*FullProject, *http.Response, error) {
|
||||||
apiEndpoint := fmt.Sprintf("/rest/api/2/project/%s", projectID)
|
apiEndpoint := fmt.Sprintf("/rest/api/2/project/%s", projectID)
|
||||||
req, err := s.client.NewRequest("GET", apiEndpoint, nil)
|
req, err := s.client.NewRequest("GET", apiEndpoint, nil)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, nil, err
|
return nil, nil, err
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ func TestProjectGetAll(t *testing.T) {
|
|||||||
defer teardown()
|
defer teardown()
|
||||||
testApiEdpoint := "/rest/api/2/project"
|
testApiEdpoint := "/rest/api/2/project"
|
||||||
|
|
||||||
raw, err := ioutil.ReadFile("./json_mocks/all_projects.json")
|
raw, err := ioutil.ReadFile("./mocks/all_projects.json")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err.Error())
|
t.Error(err.Error())
|
||||||
}
|
}
|
||||||
@ -36,7 +36,7 @@ func TestProjectGet(t *testing.T) {
|
|||||||
defer teardown()
|
defer teardown()
|
||||||
testApiEdpoint := "/rest/api/2/project/12310505"
|
testApiEdpoint := "/rest/api/2/project/12310505"
|
||||||
|
|
||||||
raw, err := ioutil.ReadFile("./json_mocks/project.json")
|
raw, err := ioutil.ReadFile("./mocks/project.json")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Error(err.Error())
|
t.Error(err.Error())
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user