From 14d4b869a55200f8af9486935aff0350770804c8 Mon Sep 17 00:00:00 2001 From: gfleury Date: Wed, 18 Mar 2020 15:20:48 -0300 Subject: [PATCH] Adding mock server for simple projects --- default_api_test.go | 20 +- test/bb-mock-server/go.mod | 5 + test/bb-mock-server/go.sum | 2 + test/bb-mock-server/go/README.md | 25 + test/bb-mock-server/go/api_default.go | 5750 +++++++++++++++++ test/bb-mock-server/go/logger.go | 32 + test/bb-mock-server/go/mockserver.go | 15 + test/bb-mock-server/go/routers.go | 1394 ++++ .../mocked_responses/AddGroupToUser.json | 1 + .../mocked_responses/Create.json | 35 + .../mocked_responses/Delete.json | 1 + .../mocked_responses/GetUser.json | 1 + test/bb-mock-server/mockserver.go | 20 + 13 files changed, 7296 insertions(+), 5 deletions(-) create mode 100644 test/bb-mock-server/go.mod create mode 100644 test/bb-mock-server/go.sum create mode 100644 test/bb-mock-server/go/README.md create mode 100644 test/bb-mock-server/go/api_default.go create mode 100644 test/bb-mock-server/go/logger.go create mode 100644 test/bb-mock-server/go/mockserver.go create mode 100644 test/bb-mock-server/go/routers.go create mode 100644 test/bb-mock-server/mocked_responses/AddGroupToUser.json create mode 100644 test/bb-mock-server/mocked_responses/Create.json create mode 100644 test/bb-mock-server/mocked_responses/Delete.json create mode 100644 test/bb-mock-server/mocked_responses/GetUser.json create mode 100644 test/bb-mock-server/mockserver.go diff --git a/default_api_test.go b/default_api_test.go index eb6e8fe..e499d18 100644 --- a/default_api_test.go +++ b/default_api_test.go @@ -505,7 +505,9 @@ func TestDefaultApiService_Create(t *testing.T) { t.Errorf("DefaultApiService.Create() error = %v, wantErr %v", err, tt.wantErr) return } - got.Response = nil + if got != nil { + got.Response = nil + } if !reflect.DeepEqual(got, tt.want) { t.Errorf("DefaultApiService.Create() = %v, want %v", got, tt.want) } @@ -604,7 +606,9 @@ func TestDefaultApiService_CreatePullRequest(t *testing.T) { t.Errorf("DefaultApiService.Create() error = %v, wantErr %v", err, tt.wantErr) return } - got.Response = nil + if got != nil { + got.Response = nil + } if !reflect.DeepEqual(got, tt.want) { t.Errorf("DefaultApiService.Create() = %v, want %v", got, tt.want) } @@ -1147,7 +1151,9 @@ func TestDefaultApiService_Delete(t *testing.T) { t.Errorf("DefaultApiService.Delete() error = %v, wantErr %v", err, tt.wantErr) return } - got.Response = nil + if got != nil { + got.Response = nil + } if !reflect.DeepEqual(got, tt.want) { t.Errorf("DefaultApiService.Delete() = %v, want %v", got, tt.want) } @@ -4665,7 +4671,9 @@ func TestDefaultApiService_GetSSHKeys(t *testing.T) { t.Errorf("DefaultApiService.GetSSHKeys() error = %v, wantErr %v", err, tt.wantErr) return } - got.Response = nil + if got != nil { + got.Response = nil + } if !reflect.DeepEqual(got, tt.want) { t.Errorf("DefaultApiService.GetSSHKeys() = %v, want %v", got, tt.want) } @@ -4753,7 +4761,9 @@ func TestDefaultApiService_GetUser(t *testing.T) { t.Errorf("DefaultApiService.GetUser() error = %v, wantErr %v", err, tt.wantErr) return } - got.Response = nil + if got != nil { + got.Response = nil + } if !reflect.DeepEqual(got, tt.want) { t.Errorf("DefaultApiService.GetUser() = %v, want %v", got, tt.want) } diff --git a/test/bb-mock-server/go.mod b/test/bb-mock-server/go.mod new file mode 100644 index 0000000..90843f5 --- /dev/null +++ b/test/bb-mock-server/go.mod @@ -0,0 +1,5 @@ +module github.com/gfleury/go-bitbucket-v1/test/bb-mock-server + +go 1.14 + +require github.com/gorilla/mux v1.7.4 diff --git a/test/bb-mock-server/go.sum b/test/bb-mock-server/go.sum new file mode 100644 index 0000000..abb0613 --- /dev/null +++ b/test/bb-mock-server/go.sum @@ -0,0 +1,2 @@ +github.com/gorilla/mux v1.7.4 h1:VuZ8uybHlWmqV03+zRzdwKL4tUnIp1MAQtp1mIFE1bc= +github.com/gorilla/mux v1.7.4/go.mod h1:DVbg23sWSpFRCP0SfiEN6jmj59UnW/n46BH5rLB71So= diff --git a/test/bb-mock-server/go/README.md b/test/bb-mock-server/go/README.md new file mode 100644 index 0000000..506afba --- /dev/null +++ b/test/bb-mock-server/go/README.md @@ -0,0 +1,25 @@ +# Go API Server for swagger + +Bitbucket Server API (former stash). + +## Overview +This server was generated by the [swagger-codegen] +(https://github.com/swagger-api/swagger-codegen) project. +By using the [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) from a remote server, you can easily generate a server stub. +- + +To see how to make this your own, look here: + +[README](https://github.com/swagger-api/swagger-codegen/blob/master/README.md) + +- API version: 1.0.0 +- Build date: 2020-03-18T00:40:49.792Z + + +### Running the server +To run the server, follow these simple steps: + +``` +go run main.go +``` + diff --git a/test/bb-mock-server/go/api_default.go b/test/bb-mock-server/go/api_default.go new file mode 100644 index 0000000..f5f3f42 --- /dev/null +++ b/test/bb-mock-server/go/api_default.go @@ -0,0 +1,5750 @@ +/* + * Bitbucket Server API + * + * Bitbucket Server API (former stash). + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "fmt" + "io/ioutil" + "log" + "net/http" + "os" + + "github.com/gorilla/mux" +) + +func AddGroupToUser(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func AddUserToGroup(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func AddUserToGroups(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func AddUsersToGroup(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func Approve(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func AssignParticipantRole(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func CanMerge(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func ClearSenderAddress(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func ClearUserCaptchaChallenge(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func CountPullRequestTasks(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func Create(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func CreateBranch(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func CreateComment(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func CreateCommentCommit(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func CreateGroup(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func CreateProject(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func CreateRepository(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func CreateTag(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func CreateTask(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func CreateUser(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func CreateWebhook(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func Decline(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func Delete(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func DeleteAvatar(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func DeleteComment(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func DeleteCommentCommit(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func DeleteGroup(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func DeleteMailConfig(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func DeleteProject(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func DeleteRepository(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func DeleteRepositoryHook(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func DeleteTask(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func DeleteUser(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func DeleteWebhook(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func DisableHook(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func DisableHookRepo(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func EditFile(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func EnableHook(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func EnableHookRepo(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func FindGroupsForUser(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func FindOtherGroupsForUser(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func FindUsersInGroup(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func FindUsersNotInGroup(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func FindWebhooks(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func ForkRepository(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func Get(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetActivities(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetApplicationProperties(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetArchive(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetAvatar(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetBranches(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetChanges(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetChangesFile(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetComment(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetCommentCommit(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetComments(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetCommentsCommit(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetCommit(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetCommits(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetCommitsPR(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetContentBrowse(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetContentFile(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetContentRepository(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetContentRepositoryPath(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetDefaultBranch(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetForkedRepositories(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetGroups(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetGroupsAdmin(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetGroupsWithAnyPermission(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetGroupsWithAnyPermissionProject(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetGroupsWithAnyPermissionRepository(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetGroupsWithoutAnyPermission(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetGroupsWithoutAnyPermissionProject(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetGroupsWithoutAnyPermissionRepository(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetInformation(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetLatestInvocation(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetLevel(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetLicense(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetMailConfig(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetMergeConfig(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetPage(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetProject(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetProjectAvatar(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetProjects(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetPullRequestCount(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetPullRequestSettings(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetPullRequestSettingsSCM(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetPullRequestSuggestions(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetPullRequestTasks(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetPullRequests(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetPullRequestsInbox(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetRelatedRepositories(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetRepositories(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetRepositoriesAll(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetRepositoriesRecentlyAccessed(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetRepository(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetRepositoryHook(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetRepositoryHookSettings(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetRepositoryHooks(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetRepositoryHooksSettings(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetRootLevel(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetSenderAddress(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetSettings(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetSettingsHook(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetStatistics(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetStatisticsSummary(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetTag(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetTags(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetTask(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetUser(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetUserSettings(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetUsers(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetUsersAll(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetUsersWithAnyPermission(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetUsersWithAnyPermissionAll(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetUsersWithAnyPermissionProject(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetUsersWithoutAnyPermission(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetUsersWithoutPermission(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetUsersWithoutPermissionProject(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func GetWebhook(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func HasAllUserPermission(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func ListParticipants(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func Merge(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func ModifyAllUserPermission(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func Preview(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func RemoveGroupFromUser(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func RemoveUserFromGroup(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func RenameUser(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func Reopen(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func RetryCreateRepository(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func RevokePermissionsForGroup(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func RevokePermissionsForGroupAll(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func RevokePermissionsForGroupProject(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func RevokePermissionsForUser(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func RevokePermissionsForUserAll(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func RevokePermissionsForUserProject(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func Search(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func SetDefaultBranch(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func SetLevel(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func SetMailConfig(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func SetMergeConfig(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func SetPermissionForGroup(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func SetPermissionForGroups(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func SetPermissionForGroupsProject(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func SetPermissionForUser(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func SetPermissionForUsers(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func SetPermissionForUsersProject(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func SetRootLevel(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func SetSenderAddress(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func SetSettings(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func SetSettingsProject(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func Stream(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func StreamChanges(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func StreamChangesCompare(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func StreamCommits(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func StreamDiff(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func StreamDiffCommit(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func StreamDiffCommits(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func StreamDiffCompare(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func StreamDiffPR(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func StreamDiffRepository(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func StreamDiffRepositoryFile(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func StreamFiles(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func StreamFilesLastMofied(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func StreamFilesRepository(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func TestWebhook(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UnassignParticipantRole(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UnassignParticipantRolePR(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func Unwatch(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UnwatchPR(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func Update(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UpdateComment(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UpdateCommentCommit(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UpdateLicense(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UpdateProject(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UpdatePullRequestSettings(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UpdatePullRequestSettingsSCM(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UpdateRepository(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UpdateSettings(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UpdateStatus(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UpdateTask(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UpdateUserDetails(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UpdateUserDetailsAll(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UpdateUserPassword(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UpdateUserPasswordAll(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UpdateWebhook(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UploadAvatar(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func UploadAvatarProject(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func WatchCommit(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func WatchPR(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} + +func WithdrawApproval(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Content-Type", "application/json; charset=UTF-8") + w.WriteHeader(http.StatusOK) + handlerName := "UNKNOWN" + if route := mux.CurrentRoute(r); route != nil { + routeName := route.GetName() + if routeName != "" { + handlerName = routeName + } + path, err := route.GetPathTemplate() + if err == nil { + fmt.Println(path) + } + } + fmt.Println(handlerName) + fileName := fmt.Sprintf("mocked_responses/%s.json", handlerName) + response, err := ioutil.ReadFile(fileName) + if err == nil { + w.Write(response) + } else { + file, err := os.Create(fileName) + if err != nil { + log.Fatal(err.Error()) + } + file.Write([]byte("{}")) + file.Close() + } + +} diff --git a/test/bb-mock-server/go/logger.go b/test/bb-mock-server/go/logger.go new file mode 100644 index 0000000..7cb679f --- /dev/null +++ b/test/bb-mock-server/go/logger.go @@ -0,0 +1,32 @@ +/* + * Bitbucket Server API + * + * Bitbucket Server API (former stash). + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "log" + "net/http" + "time" +) + +func Logger(inner http.Handler, name string) http.Handler { + return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + start := time.Now() + + inner.ServeHTTP(w, r) + + log.Printf( + "%s %s %s %s", + r.Method, + r.RequestURI, + name, + time.Since(start), + ) + }) +} diff --git a/test/bb-mock-server/go/mockserver.go b/test/bb-mock-server/go/mockserver.go new file mode 100644 index 0000000..df3727f --- /dev/null +++ b/test/bb-mock-server/go/mockserver.go @@ -0,0 +1,15 @@ +package swagger + +import ( + "fmt" + "log" + "net/http" +) + +func RunServer(port int) error { + log.Printf("Mock Server started") + + router := NewRouter() + + return http.ListenAndServe(fmt.Sprintf(":%d", port), router) +} diff --git a/test/bb-mock-server/go/routers.go b/test/bb-mock-server/go/routers.go new file mode 100644 index 0000000..3a49797 --- /dev/null +++ b/test/bb-mock-server/go/routers.go @@ -0,0 +1,1394 @@ +/* + * Bitbucket Server API + * + * Bitbucket Server API (former stash). + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package swagger + +import ( + "fmt" + "net/http" + "strings" + + "github.com/gorilla/mux" +) + +type Route struct { + Name string + Method string + Pattern string + HandlerFunc http.HandlerFunc +} + +type Routes []Route + +func NewRouter() *mux.Router { + router := mux.NewRouter().StrictSlash(true) + for _, route := range routes { + var handler http.Handler + handler = route.HandlerFunc + handler = Logger(handler, route.Name) + + router. + Methods(route.Method). + Path(route.Pattern). + Name(route.Name). + Handler(handler) + } + + return router +} + +func Index(w http.ResponseWriter, r *http.Request) { + fmt.Fprintf(w, "Hello World!") +} + +var routes = Routes{ + Route{ + "Index", + "GET", + "/rest/", + Index, + }, + + Route{ + "AddGroupToUser", + strings.ToUpper("Post"), + "/rest/api/1.0/admin/users/add-group", + AddGroupToUser, + }, + + Route{ + "AddUserToGroup", + strings.ToUpper("Post"), + "/rest/api/1.0/admin/groups/add-user", + AddUserToGroup, + }, + + Route{ + "AddUserToGroups", + strings.ToUpper("Post"), + "/rest/api/1.0/admin/users/add-groups", + AddUserToGroups, + }, + + Route{ + "AddUsersToGroup", + strings.ToUpper("Post"), + "/rest/api/1.0/admin/groups/add-users", + AddUsersToGroup, + }, + + Route{ + "Approve", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/approve", + Approve, + }, + + Route{ + "AssignParticipantRole", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants", + AssignParticipantRole, + }, + + Route{ + "CanMerge", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge", + CanMerge, + }, + + Route{ + "ClearSenderAddress", + strings.ToUpper("Delete"), + "/rest/api/1.0/admin/mail-server/sender-address", + ClearSenderAddress, + }, + + Route{ + "ClearUserCaptchaChallenge", + strings.ToUpper("Delete"), + "/rest/api/1.0/admin/users/captcha", + ClearUserCaptchaChallenge, + }, + + Route{ + "CountPullRequestTasks", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/tasks/count", + CountPullRequestTasks, + }, + + Route{ + "Create", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests", + Create, + }, + + Route{ + "CreateBranch", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/branches", + CreateBranch, + }, + + Route{ + "CreateComment", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments", + CreateComment, + }, + + Route{ + "CreateCommentCommit", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments", + CreateCommentCommit, + }, + + Route{ + "CreateGroup", + strings.ToUpper("Post"), + "/rest/api/1.0/admin/groups", + CreateGroup, + }, + + Route{ + "CreateProject", + strings.ToUpper("Post"), + "/rest/api/1.0/projects", + CreateProject, + }, + + Route{ + "CreateRepository", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/repos", + CreateRepository, + }, + + Route{ + "CreateTag", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/tags", + CreateTag, + }, + + Route{ + "CreateTask", + strings.ToUpper("Post"), + "/rest/api/1.0/tasks", + CreateTask, + }, + + Route{ + "CreateUser", + strings.ToUpper("Post"), + "/rest/api/1.0/admin/users", + CreateUser, + }, + + Route{ + "CreateWebhook", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks", + CreateWebhook, + }, + + Route{ + "Decline", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/decline", + Decline, + }, + + Route{ + "Delete", + strings.ToUpper("Delete"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}", + Delete, + }, + + Route{ + "DeleteAvatar", + strings.ToUpper("Delete"), + "/rest/api/1.0/users/{userSlug}/avatar.png", + DeleteAvatar, + }, + + Route{ + "DeleteComment", + strings.ToUpper("Delete"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}", + DeleteComment, + }, + + Route{ + "DeleteCommentCommit", + strings.ToUpper("Delete"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}", + DeleteCommentCommit, + }, + + Route{ + "DeleteGroup", + strings.ToUpper("Delete"), + "/rest/api/1.0/admin/groups", + DeleteGroup, + }, + + Route{ + "DeleteMailConfig", + strings.ToUpper("Delete"), + "/rest/api/1.0/admin/mail-server", + DeleteMailConfig, + }, + + Route{ + "DeleteProject", + strings.ToUpper("Delete"), + "/rest/api/1.0/projects/{projectKey}", + DeleteProject, + }, + + Route{ + "DeleteRepository", + strings.ToUpper("Delete"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}", + DeleteRepository, + }, + + Route{ + "DeleteRepositoryHook", + strings.ToUpper("Delete"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}", + DeleteRepositoryHook, + }, + + Route{ + "DeleteTask", + strings.ToUpper("Delete"), + "/rest/api/1.0/tasks/{taskId}", + DeleteTask, + }, + + Route{ + "DeleteUser", + strings.ToUpper("Delete"), + "/rest/api/1.0/admin/users", + DeleteUser, + }, + + Route{ + "DeleteWebhook", + strings.ToUpper("Delete"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}", + DeleteWebhook, + }, + + Route{ + "DisableHook", + strings.ToUpper("Delete"), + "/rest/api/1.0/projects/{projectKey}/settings/hooks/{hookKey}/enabled", + DisableHook, + }, + + Route{ + "DisableHookRepo", + strings.ToUpper("Delete"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/enabled", + DisableHookRepo, + }, + + Route{ + "EditFile", + strings.ToUpper("Put"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/browse/{path}", + EditFile, + }, + + Route{ + "EnableHook", + strings.ToUpper("Put"), + "/rest/api/1.0/projects/{projectKey}/settings/hooks/{hookKey}/enabled", + EnableHook, + }, + + Route{ + "EnableHookRepo", + strings.ToUpper("Put"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/enabled", + EnableHookRepo, + }, + + Route{ + "FindGroupsForUser", + strings.ToUpper("Get"), + "/rest/api/1.0/admin/users/more-members", + FindGroupsForUser, + }, + + Route{ + "FindOtherGroupsForUser", + strings.ToUpper("Get"), + "/rest/api/1.0/admin/users/more-non-members", + FindOtherGroupsForUser, + }, + + Route{ + "FindUsersInGroup", + strings.ToUpper("Get"), + "/rest/api/1.0/admin/groups/more-members", + FindUsersInGroup, + }, + + Route{ + "FindUsersNotInGroup", + strings.ToUpper("Get"), + "/rest/api/1.0/admin/groups/more-non-members", + FindUsersNotInGroup, + }, + + Route{ + "FindWebhooks", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks", + FindWebhooks, + }, + + Route{ + "ForkRepository", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}", + ForkRepository, + }, + + Route{ + "Get", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}", + Get, + }, + + Route{ + "GetActivities", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/activities", + GetActivities, + }, + + Route{ + "GetApplicationProperties", + strings.ToUpper("Get"), + "/rest/api/1.0/application-properties", + GetApplicationProperties, + }, + + Route{ + "GetArchive", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/archive", + GetArchive, + }, + + Route{ + "GetAvatar", + strings.ToUpper("Get"), + "/rest/api/1.0/hooks/{hookKey}/avatar", + GetAvatar, + }, + + Route{ + "GetBranches", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/branches", + GetBranches, + }, + + Route{ + "GetChanges", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/changes", + GetChanges, + }, + + Route{ + "GetChangesFile", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/changes", + GetChangesFile, + }, + + Route{ + "GetComment", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}", + GetComment, + }, + + Route{ + "GetCommentCommit", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}", + GetCommentCommit, + }, + + Route{ + "GetComments", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments", + GetComments, + }, + + Route{ + "GetCommentsCommit", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments", + GetCommentsCommit, + }, + + Route{ + "GetCommit", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}", + GetCommit, + }, + + Route{ + "GetCommits", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits", + GetCommits, + }, + + Route{ + "GetCommitsPR", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commits", + GetCommitsPR, + }, + + Route{ + "GetContentBrowse", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/browse", + GetContentBrowse, + }, + + Route{ + "GetContentFile", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/browse/{path}", + GetContentFile, + }, + + Route{ + "GetContentRepository", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/raw", + GetContentRepository, + }, + + Route{ + "GetContentRepositoryPath", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/raw/{path}", + GetContentRepositoryPath, + }, + + Route{ + "GetDefaultBranch", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/branches/default", + GetDefaultBranch, + }, + + Route{ + "GetForkedRepositories", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/forks", + GetForkedRepositories, + }, + + Route{ + "GetGroups", + strings.ToUpper("Get"), + "/rest/api/1.0/groups", + GetGroups, + }, + + Route{ + "GetGroupsAdmin", + strings.ToUpper("Get"), + "/rest/api/1.0/admin/groups", + GetGroupsAdmin, + }, + + Route{ + "GetGroupsWithAnyPermission", + strings.ToUpper("Get"), + "/rest/api/1.0/admin/permissions/groups", + GetGroupsWithAnyPermission, + }, + + Route{ + "GetGroupsWithAnyPermissionProject", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/permissions/groups", + GetGroupsWithAnyPermissionProject, + }, + + Route{ + "GetGroupsWithAnyPermissionRepository", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions/groups", + GetGroupsWithAnyPermissionRepository, + }, + + Route{ + "GetGroupsWithoutAnyPermission", + strings.ToUpper("Get"), + "/rest/api/1.0/admin/permissions/groups/none", + GetGroupsWithoutAnyPermission, + }, + + Route{ + "GetGroupsWithoutAnyPermissionProject", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/permissions/groups/none", + GetGroupsWithoutAnyPermissionProject, + }, + + Route{ + "GetGroupsWithoutAnyPermissionRepository", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions/groups/none", + GetGroupsWithoutAnyPermissionRepository, + }, + + Route{ + "GetInformation", + strings.ToUpper("Get"), + "/rest/api/1.0/admin/cluster", + GetInformation, + }, + + Route{ + "GetLatestInvocation", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/latest", + GetLatestInvocation, + }, + + Route{ + "GetLevel", + strings.ToUpper("Get"), + "/rest/api/1.0/logs/logger/{loggerName}", + GetLevel, + }, + + Route{ + "GetLicense", + strings.ToUpper("Get"), + "/rest/api/1.0/admin/license", + GetLicense, + }, + + Route{ + "GetMailConfig", + strings.ToUpper("Get"), + "/rest/api/1.0/admin/mail-server", + GetMailConfig, + }, + + Route{ + "GetMergeConfig", + strings.ToUpper("Get"), + "/rest/api/1.0/admin/pull-requests/{scmId}", + GetMergeConfig, + }, + + Route{ + "GetPage", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests", + GetPage, + }, + + Route{ + "GetProject", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}", + GetProject, + }, + + Route{ + "GetProjectAvatar", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/avatar.png", + GetProjectAvatar, + }, + + Route{ + "GetProjects", + strings.ToUpper("Get"), + "/rest/api/1.0/projects", + GetProjects, + }, + + Route{ + "GetPullRequestCount", + strings.ToUpper("Get"), + "/rest/api/1.0/inbox/pull-requests/count", + GetPullRequestCount, + }, + + Route{ + "GetPullRequestSettings", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/pull-requests", + GetPullRequestSettings, + }, + + Route{ + "GetPullRequestSettingsSCM", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/settings/pull-requests/{scmId}", + GetPullRequestSettingsSCM, + }, + + Route{ + "GetPullRequestSuggestions", + strings.ToUpper("Get"), + "/rest/api/1.0/dashboard/pull-request-suggestions", + GetPullRequestSuggestions, + }, + + Route{ + "GetPullRequestTasks", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/tasks", + GetPullRequestTasks, + }, + + Route{ + "GetPullRequests", + strings.ToUpper("Get"), + "/rest/api/1.0/dashboard/pull-requests", + GetPullRequests, + }, + + Route{ + "GetPullRequestsInbox", + strings.ToUpper("Get"), + "/rest/api/1.0/inbox/pull-requests", + GetPullRequestsInbox, + }, + + Route{ + "GetRelatedRepositories", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/related", + GetRelatedRepositories, + }, + + Route{ + "GetRepositories", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos", + GetRepositories, + }, + + Route{ + "GetRepositoriesAll", + strings.ToUpper("Get"), + "/rest/api/1.0/repos", + GetRepositoriesAll, + }, + + Route{ + "GetRepositoriesRecentlyAccessed", + strings.ToUpper("Get"), + "/rest/api/1.0/profile/recent/repos", + GetRepositoriesRecentlyAccessed, + }, + + Route{ + "GetRepository", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}", + GetRepository, + }, + + Route{ + "GetRepositoryHook", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/settings/hooks/{hookKey}", + GetRepositoryHook, + }, + + Route{ + "GetRepositoryHookSettings", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}", + GetRepositoryHookSettings, + }, + + Route{ + "GetRepositoryHooks", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/settings/hooks", + GetRepositoryHooks, + }, + + Route{ + "GetRepositoryHooksSettings", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks", + GetRepositoryHooksSettings, + }, + + Route{ + "GetRootLevel", + strings.ToUpper("Get"), + "/rest/api/1.0/logs/rootLogger", + GetRootLevel, + }, + + Route{ + "GetSenderAddress", + strings.ToUpper("Get"), + "/rest/api/1.0/admin/mail-server/sender-address", + GetSenderAddress, + }, + + Route{ + "GetSettings", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/settings/hooks/{hookKey}/settings", + GetSettings, + }, + + Route{ + "GetSettingsHook", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/settings", + GetSettingsHook, + }, + + Route{ + "GetStatistics", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/statistics", + GetStatistics, + }, + + Route{ + "GetStatisticsSummary", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/statistics/summary", + GetStatisticsSummary, + }, + + Route{ + "GetTag", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/tags/{name}", + GetTag, + }, + + Route{ + "GetTags", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/tags", + GetTags, + }, + + Route{ + "GetTask", + strings.ToUpper("Get"), + "/rest/api/1.0/tasks/{taskId}", + GetTask, + }, + + Route{ + "GetUser", + strings.ToUpper("Get"), + "/rest/api/1.0/users/{userSlug}", + GetUser, + }, + + Route{ + "GetUserSettings", + strings.ToUpper("Get"), + "/rest/api/1.0/users/{userSlug}/settings", + GetUserSettings, + }, + + Route{ + "GetUsers", + strings.ToUpper("Get"), + "/rest/api/1.0/admin/users", + GetUsers, + }, + + Route{ + "GetUsersAll", + strings.ToUpper("Get"), + "/rest/api/1.0/users", + GetUsersAll, + }, + + Route{ + "GetUsersWithAnyPermission", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions/users", + GetUsersWithAnyPermission, + }, + + Route{ + "GetUsersWithAnyPermissionAll", + strings.ToUpper("Get"), + "/rest/api/1.0/admin/permissions/users", + GetUsersWithAnyPermissionAll, + }, + + Route{ + "GetUsersWithAnyPermissionProject", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/permissions/users", + GetUsersWithAnyPermissionProject, + }, + + Route{ + "GetUsersWithoutAnyPermission", + strings.ToUpper("Get"), + "/rest/api/1.0/admin/permissions/users/none", + GetUsersWithoutAnyPermission, + }, + + Route{ + "GetUsersWithoutPermission", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions/users/none", + GetUsersWithoutPermission, + }, + + Route{ + "GetUsersWithoutPermissionProject", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/permissions/users/none", + GetUsersWithoutPermissionProject, + }, + + Route{ + "GetWebhook", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}", + GetWebhook, + }, + + Route{ + "HasAllUserPermission", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/permissions/{permission}/all", + HasAllUserPermission, + }, + + Route{ + "ListParticipants", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants", + ListParticipants, + }, + + Route{ + "Merge", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge", + Merge, + }, + + Route{ + "ModifyAllUserPermission", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/permissions/{permission}/all", + ModifyAllUserPermission, + }, + + Route{ + "Preview", + strings.ToUpper("Post"), + "/rest/api/1.0/markup/preview", + Preview, + }, + + Route{ + "RemoveGroupFromUser", + strings.ToUpper("Post"), + "/rest/api/1.0/admin/users/remove-group", + RemoveGroupFromUser, + }, + + Route{ + "RemoveUserFromGroup", + strings.ToUpper("Post"), + "/rest/api/1.0/admin/groups/remove-user", + RemoveUserFromGroup, + }, + + Route{ + "RenameUser", + strings.ToUpper("Post"), + "/rest/api/1.0/admin/users/rename", + RenameUser, + }, + + Route{ + "Reopen", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/reopen", + Reopen, + }, + + Route{ + "RetryCreateRepository", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/recreate", + RetryCreateRepository, + }, + + Route{ + "RevokePermissionsForGroup", + strings.ToUpper("Delete"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions/groups", + RevokePermissionsForGroup, + }, + + Route{ + "RevokePermissionsForGroupAll", + strings.ToUpper("Delete"), + "/rest/api/1.0/admin/permissions/groups", + RevokePermissionsForGroupAll, + }, + + Route{ + "RevokePermissionsForGroupProject", + strings.ToUpper("Delete"), + "/rest/api/1.0/projects/{projectKey}/permissions/groups", + RevokePermissionsForGroupProject, + }, + + Route{ + "RevokePermissionsForUser", + strings.ToUpper("Delete"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions/users", + RevokePermissionsForUser, + }, + + Route{ + "RevokePermissionsForUserAll", + strings.ToUpper("Delete"), + "/rest/api/1.0/admin/permissions/users", + RevokePermissionsForUserAll, + }, + + Route{ + "RevokePermissionsForUserProject", + strings.ToUpper("Delete"), + "/rest/api/1.0/projects/{projectKey}/permissions/users", + RevokePermissionsForUserProject, + }, + + Route{ + "Search", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/participants", + Search, + }, + + Route{ + "SetDefaultBranch", + strings.ToUpper("Put"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/branches/default", + SetDefaultBranch, + }, + + Route{ + "SetLevel", + strings.ToUpper("Put"), + "/rest/api/1.0/logs/logger/{loggerName}/{levelName}", + SetLevel, + }, + + Route{ + "SetMailConfig", + strings.ToUpper("Put"), + "/rest/api/1.0/admin/mail-server", + SetMailConfig, + }, + + Route{ + "SetMergeConfig", + strings.ToUpper("Post"), + "/rest/api/1.0/admin/pull-requests/{scmId}", + SetMergeConfig, + }, + + Route{ + "SetPermissionForGroup", + strings.ToUpper("Put"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions/groups", + SetPermissionForGroup, + }, + + Route{ + "SetPermissionForGroups", + strings.ToUpper("Put"), + "/rest/api/1.0/admin/permissions/groups", + SetPermissionForGroups, + }, + + Route{ + "SetPermissionForGroupsProject", + strings.ToUpper("Put"), + "/rest/api/1.0/projects/{projectKey}/permissions/groups", + SetPermissionForGroupsProject, + }, + + Route{ + "SetPermissionForUser", + strings.ToUpper("Put"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/permissions/users", + SetPermissionForUser, + }, + + Route{ + "SetPermissionForUsers", + strings.ToUpper("Put"), + "/rest/api/1.0/admin/permissions/users", + SetPermissionForUsers, + }, + + Route{ + "SetPermissionForUsersProject", + strings.ToUpper("Put"), + "/rest/api/1.0/projects/{projectKey}/permissions/users", + SetPermissionForUsersProject, + }, + + Route{ + "SetRootLevel", + strings.ToUpper("Put"), + "/rest/api/1.0/logs/rootLogger/{levelName}", + SetRootLevel, + }, + + Route{ + "SetSenderAddress", + strings.ToUpper("Put"), + "/rest/api/1.0/admin/mail-server/sender-address", + SetSenderAddress, + }, + + Route{ + "SetSettings", + strings.ToUpper("Put"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}/settings", + SetSettings, + }, + + Route{ + "SetSettingsProject", + strings.ToUpper("Put"), + "/rest/api/1.0/projects/{projectKey}/settings/hooks/{hookKey}/settings", + SetSettingsProject, + }, + + Route{ + "Stream", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/last-modified", + Stream, + }, + + Route{ + "StreamChanges", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/changes", + StreamChanges, + }, + + Route{ + "StreamChangesCompare", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/compare/changes", + StreamChangesCompare, + }, + + Route{ + "StreamCommits", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/compare/commits", + StreamCommits, + }, + + Route{ + "StreamDiff", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff/{path}", + StreamDiff, + }, + + Route{ + "StreamDiffCommit", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/diff", + StreamDiffCommit, + }, + + Route{ + "StreamDiffCommits", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/diff/{path}", + StreamDiffCommits, + }, + + Route{ + "StreamDiffCompare", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/compare/diff{path}", + StreamDiffCompare, + }, + + Route{ + "StreamDiffPR", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff", + StreamDiffPR, + }, + + Route{ + "StreamDiffRepository", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/diff", + StreamDiffRepository, + }, + + Route{ + "StreamDiffRepositoryFile", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/diff/{path}", + StreamDiffRepositoryFile, + }, + + Route{ + "StreamFiles", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/files", + StreamFiles, + }, + + Route{ + "StreamFilesLastMofied", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/last-modified/{path}", + StreamFilesLastMofied, + }, + + Route{ + "StreamFilesRepository", + strings.ToUpper("Get"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/files/{path}", + StreamFilesRepository, + }, + + Route{ + "TestWebhook", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks/test", + TestWebhook, + }, + + Route{ + "UnassignParticipantRole", + strings.ToUpper("Delete"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug}", + UnassignParticipantRole, + }, + + Route{ + "UnassignParticipantRolePR", + strings.ToUpper("Delete"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants", + UnassignParticipantRolePR, + }, + + Route{ + "Unwatch", + strings.ToUpper("Delete"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/watch", + Unwatch, + }, + + Route{ + "UnwatchPR", + strings.ToUpper("Delete"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watch", + UnwatchPR, + }, + + Route{ + "Update", + strings.ToUpper("Put"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}", + Update, + }, + + Route{ + "UpdateComment", + strings.ToUpper("Put"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}", + UpdateComment, + }, + + Route{ + "UpdateCommentCommit", + strings.ToUpper("Put"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}", + UpdateCommentCommit, + }, + + Route{ + "UpdateLicense", + strings.ToUpper("Post"), + "/rest/api/1.0/admin/license", + UpdateLicense, + }, + + Route{ + "UpdateProject", + strings.ToUpper("Put"), + "/rest/api/1.0/projects/{projectKey}", + UpdateProject, + }, + + Route{ + "UpdatePullRequestSettings", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/settings/pull-requests", + UpdatePullRequestSettings, + }, + + Route{ + "UpdatePullRequestSettingsSCM", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/settings/pull-requests/{scmId}", + UpdatePullRequestSettingsSCM, + }, + + Route{ + "UpdateRepository", + strings.ToUpper("Put"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}", + UpdateRepository, + }, + + Route{ + "UpdateSettings", + strings.ToUpper("Post"), + "/rest/api/1.0/users/{userSlug}/settings", + UpdateSettings, + }, + + Route{ + "UpdateStatus", + strings.ToUpper("Put"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug}", + UpdateStatus, + }, + + Route{ + "UpdateTask", + strings.ToUpper("Put"), + "/rest/api/1.0/tasks/{taskId}", + UpdateTask, + }, + + Route{ + "UpdateUserDetails", + strings.ToUpper("Put"), + "/rest/api/1.0/admin/users", + UpdateUserDetails, + }, + + Route{ + "UpdateUserDetailsAll", + strings.ToUpper("Put"), + "/rest/api/1.0/users", + UpdateUserDetailsAll, + }, + + Route{ + "UpdateUserPassword", + strings.ToUpper("Put"), + "/rest/api/1.0/admin/users/credentials", + UpdateUserPassword, + }, + + Route{ + "UpdateUserPasswordAll", + strings.ToUpper("Put"), + "/rest/api/1.0/users/credentials", + UpdateUserPasswordAll, + }, + + Route{ + "UpdateWebhook", + strings.ToUpper("Put"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}", + UpdateWebhook, + }, + + Route{ + "UploadAvatar", + strings.ToUpper("Post"), + "/rest/api/1.0/users/{userSlug}/avatar.png", + UploadAvatar, + }, + + Route{ + "UploadAvatarProject", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/avatar.png", + UploadAvatarProject, + }, + + Route{ + "WatchCommit", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/watch", + WatchCommit, + }, + + Route{ + "WatchPR", + strings.ToUpper("Post"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watch", + WatchPR, + }, + + Route{ + "WithdrawApproval", + strings.ToUpper("Delete"), + "/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/approve", + WithdrawApproval, + }, +} diff --git a/test/bb-mock-server/mocked_responses/AddGroupToUser.json b/test/bb-mock-server/mocked_responses/AddGroupToUser.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/test/bb-mock-server/mocked_responses/AddGroupToUser.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/test/bb-mock-server/mocked_responses/Create.json b/test/bb-mock-server/mocked_responses/Create.json new file mode 100644 index 0000000..c3da862 --- /dev/null +++ b/test/bb-mock-server/mocked_responses/Create.json @@ -0,0 +1,35 @@ +{ + "title": "Talking Nerdy", + "description": "It’s a kludge, but put the tuple from the database in the cache.", + "state": "OPEN", + "open": true, + "closed": false, + "fromRef": { + "id": "refs/heads/feature-ABC-123", + "repository": { + "slug": "my-repo", + "name": null, + "project": { + "key": "PRJ" + } + } + }, + "toRef": { + "id": "refs/heads/master", + "repository": { + "slug": "my-repo", + "name": null, + "project": { + "key": "PRJ" + } + } + }, + "locked": false, + "reviewers": [ + { + "user": { + "name": "charlie" + } + } + ] +} \ No newline at end of file diff --git a/test/bb-mock-server/mocked_responses/Delete.json b/test/bb-mock-server/mocked_responses/Delete.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/test/bb-mock-server/mocked_responses/Delete.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/test/bb-mock-server/mocked_responses/GetUser.json b/test/bb-mock-server/mocked_responses/GetUser.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/test/bb-mock-server/mocked_responses/GetUser.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/test/bb-mock-server/mockserver.go b/test/bb-mock-server/mockserver.go new file mode 100644 index 0000000..3d6a4f6 --- /dev/null +++ b/test/bb-mock-server/mockserver.go @@ -0,0 +1,20 @@ +/* + * Bitbucket Server API + * + * Bitbucket Server API (former stash). + * + * API version: 1.0.0 + * Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git) + */ + +package main + +import ( + "log" + + sw "github.com/gfleury/go-bitbucket-v1/test/bb-mock-server/go" +) + +func main() { + log.Fatal(sw.RunServer(7991)) +}