Repository: xanzy/go-gitlab
Pull request #1266 (2021-10-04 03:35:27)

add tests for award_emojis
* add tests for list and get for merge requests, snippets, issues in award_emojis


Patch:
diff --git a/award_emojis.go b/award_emojis.go
index ffa675a..8ee08bf 100644
--- a/award_emojis.go
+++ b/award_emojis.go
@@ -225,7 +225,7 @@ func (s *AwardEmojiService) createAwardEmoji(pid interface{}, resource string, r
 // GitLab API docs:
 // https://docs.gitlab.com/ce/api/award_emoji.html#award-a-new-emoji-on-a-note
 func (s *AwardEmojiService) DeleteIssueAwardEmoji(pid interface{}, issueIID, awardID int, options ...RequestOptionFunc) (*Response, error) {
-	return s.deleteAwardEmoji(pid, awardMergeRequest, issueIID, awardID, options...)
+	return s.deleteAwardEmoji(pid, awardIssue, issueIID, awardID, options...)
 }
 
 // DeleteMergeRequestAwardEmoji delete award emoji on a merge request.
@@ -241,7 +241,7 @@ func (s *AwardEmojiService) DeleteMergeRequestAwardEmoji(pid interface{}, mergeR
 // GitLab API docs:
 // https://docs.gitlab.com/ce/api/award_emoji.html#award-a-new-emoji-on-a-note
 func (s *AwardEmojiService) DeleteSnippetAwardEmoji(pid interface{}, snippetID, awardID int, options ...RequestOptionFunc) (*Response, error) {
-	return s.deleteAwardEmoji(pid, awardMergeRequest, snippetID, awardID, options...)
+	return s.deleteAwardEmoji(pid, awardSnippets, snippetID, awardID, options...)
 }
 
 // DeleteAwardEmoji Delete an award emoji on the specified resource.
diff --git a/event_webhook_types.go b/event_webhook_types.go
index 719e575..96bbed2 100644
--- a/event_webhook_types.go
+++ b/event_webhook_types.go
@@ -640,10 +640,6 @@ type PipelineEvent struct {
 		FinishedAt     string   `json:"finished_at"`
 		Duration       int      `json:"duration"`
 		QueuedDuration int      `json:"queued_duration"`
-		Variables      []struct {
-			Key   string `json:"key"`
-			Value string `json:"value"`
-		} `json:"variables"`
 	} `json:"object_attributes"`
 	MergeRequest struct {
 		ID                 int    `json:"id"`


Test patch:
diff --git a/award_emojis_test.go b/award_emojis_test.go
new file mode 100644
index 0000000..fb4d89b
--- /dev/null
+++ b/award_emojis_test.go
@@ -0,0 +1,1413 @@
+package gitlab
+
+import (
+	"fmt"
+	"net/http"
+	"testing"
+
+	"github.com/stretchr/testify/require"
+)
+
+func TestAwardEmojiService_ListMergeRequestAwardEmoji(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/merge_requests/80/award_emoji", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodGet)
+		fmt.Fprintf(w, `
+			[
+			  {
+				"id": 4,
+				"name": "1234",
+				"user": {
+				  "name": "Venkatesh Thalluri",
+				  "username": "venky333",
+				  "id": 1,
+				  "state": "active",
+				  "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+				  "web_url": "http://gitlab.example.com/venky333"
+				},
+				"awardable_id": 80,
+				"awardable_type": "Merge request"
+			  }
+			]
+		`)
+	})
+
+	want := []*AwardEmoji{{
+		ID:   4,
+		Name: "1234",
+		User: struct {
+			Name      string `json:"name"`
+			Username  string `json:"username"`
+			ID        int    `json:"id"`
+			State     string `json:"state"`
+			AvatarURL string `json:"avatar_url"`
+			WebURL    string `json:"web_url"`
+		}{
+			Name:      "Venkatesh Thalluri",
+			Username:  "venky333",
+			ID:        1,
+			State:     "active",
+			AvatarURL: "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			WebURL:    "http://gitlab.example.com/venky333",
+		},
+		CreatedAt:     nil,
+		UpdatedAt:     nil,
+		AwardableID:   80,
+		AwardableType: "Merge request",
+	}}
+
+	aes, resp, err := client.AwardEmoji.ListMergeRequestAwardEmoji(1, 80, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, aes)
+
+	aes, resp, err = client.AwardEmoji.ListMergeRequestAwardEmoji(1.01, 80, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+	require.Nil(t, aes)
+
+	aes, resp, err = client.AwardEmoji.ListMergeRequestAwardEmoji(1, 80, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, aes)
+
+	aes, resp, err = client.AwardEmoji.ListMergeRequestAwardEmoji(3, 80, nil)
+	require.Error(t, err)
+	require.Nil(t, aes)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_ListIssueAwardEmoji(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/issues/80/award_emoji", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodGet)
+		fmt.Fprintf(w, `
+			[
+			  {
+				"id": 4,
+				"name": "1234",
+				"user": {
+				  "name": "Venkatesh Thalluri",
+				  "username": "venky333",
+				  "id": 1,
+				  "state": "active",
+				  "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+				  "web_url": "http://gitlab.example.com/venky333"
+				},
+				"awardable_id": 80,
+				"awardable_type": "Issue"
+			  }
+			]
+		`)
+	})
+
+	want := []*AwardEmoji{{
+		ID:   4,
+		Name: "1234",
+		User: struct {
+			Name      string `json:"name"`
+			Username  string `json:"username"`
+			ID        int    `json:"id"`
+			State     string `json:"state"`
+			AvatarURL string `json:"avatar_url"`
+			WebURL    string `json:"web_url"`
+		}{
+			Name:      "Venkatesh Thalluri",
+			Username:  "venky333",
+			ID:        1,
+			State:     "active",
+			AvatarURL: "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			WebURL:    "http://gitlab.example.com/venky333",
+		},
+		CreatedAt:     nil,
+		UpdatedAt:     nil,
+		AwardableID:   80,
+		AwardableType: "Issue",
+	}}
+
+	aes, resp, err := client.AwardEmoji.ListIssueAwardEmoji(1, 80, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, aes)
+
+	aes, resp, err = client.AwardEmoji.ListIssueAwardEmoji(1.01, 80, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+	require.Nil(t, aes)
+
+	aes, resp, err = client.AwardEmoji.ListIssueAwardEmoji(1, 80, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, aes)
+
+	aes, resp, err = client.AwardEmoji.ListIssueAwardEmoji(3, 80, nil)
+	require.Error(t, err)
+	require.Nil(t, aes)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_ListSnippetAwardEmoji(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/snippets/80/award_emoji", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodGet)
+		fmt.Fprintf(w, `
+			[
+			  {
+				"id": 4,
+				"name": "1234",
+				"user": {
+				  "name": "Venkatesh Thalluri",
+				  "username": "venky333",
+				  "id": 1,
+				  "state": "active",
+				  "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+				  "web_url": "http://gitlab.example.com/venky333"
+				},
+				"awardable_id": 80,
+				"awardable_type": "Snippet"
+			  }
+			]
+		`)
+	})
+
+	want := []*AwardEmoji{{
+		ID:   4,
+		Name: "1234",
+		User: struct {
+			Name      string `json:"name"`
+			Username  string `json:"username"`
+			ID        int    `json:"id"`
+			State     string `json:"state"`
+			AvatarURL string `json:"avatar_url"`
+			WebURL    string `json:"web_url"`
+		}{
+			Name:      "Venkatesh Thalluri",
+			Username:  "venky333",
+			ID:        1,
+			State:     "active",
+			AvatarURL: "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			WebURL:    "http://gitlab.example.com/venky333",
+		},
+		CreatedAt:     nil,
+		UpdatedAt:     nil,
+		AwardableID:   80,
+		AwardableType: "Snippet",
+	}}
+
+	aes, resp, err := client.AwardEmoji.ListSnippetAwardEmoji(1, 80, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, aes)
+
+	aes, resp, err = client.AwardEmoji.ListSnippetAwardEmoji(1.01, 80, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+	require.Nil(t, aes)
+
+	aes, resp, err = client.AwardEmoji.ListSnippetAwardEmoji(1, 80, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, aes)
+
+	aes, resp, err = client.AwardEmoji.ListSnippetAwardEmoji(3, 80, nil)
+	require.Error(t, err)
+	require.Nil(t, aes)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_GetMergeRequestAwardEmoji(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/merge_requests/80/award_emoji/4", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodGet)
+		fmt.Fprintf(w, `
+		  {
+			"id": 4,
+			"name": "1234",
+			"user": {
+			  "name": "Venkatesh Thalluri",
+			  "username": "venky333",
+			  "id": 1,
+			  "state": "active",
+			  "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			  "web_url": "http://gitlab.example.com/venky333"
+			},
+			"awardable_id": 80,
+			"awardable_type": "Merge request"
+		  }
+		`)
+	})
+
+	want := &AwardEmoji{
+		ID:   4,
+		Name: "1234",
+		User: struct {
+			Name      string `json:"name"`
+			Username  string `json:"username"`
+			ID        int    `json:"id"`
+			State     string `json:"state"`
+			AvatarURL string `json:"avatar_url"`
+			WebURL    string `json:"web_url"`
+		}{
+			Name:      "Venkatesh Thalluri",
+			Username:  "venky333",
+			ID:        1,
+			State:     "active",
+			AvatarURL: "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			WebURL:    "http://gitlab.example.com/venky333",
+		},
+		CreatedAt:     nil,
+		UpdatedAt:     nil,
+		AwardableID:   80,
+		AwardableType: "Merge request",
+	}
+
+	ae, resp, err := client.AwardEmoji.GetMergeRequestAwardEmoji(1, 80, 4, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, ae)
+
+	ae, resp, err = client.AwardEmoji.GetMergeRequestAwardEmoji(1.01, 80, 4, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.GetMergeRequestAwardEmoji(1, 80, 4, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.GetMergeRequestAwardEmoji(3, 80, 4, nil)
+	require.Error(t, err)
+	require.Nil(t, ae)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_GetIssueAwardEmoji(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/issues/80/award_emoji/4", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodGet)
+		fmt.Fprintf(w, `
+		  {
+			"id": 4,
+			"name": "1234",
+			"user": {
+			  "name": "Venkatesh Thalluri",
+			  "username": "venky333",
+			  "id": 1,
+			  "state": "active",
+			  "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			  "web_url": "http://gitlab.example.com/venky333"
+			},
+			"awardable_id": 80,
+			"awardable_type": "Issue"
+		  }
+		`)
+	})
+
+	want := &AwardEmoji{
+		ID:   4,
+		Name: "1234",
+		User: struct {
+			Name      string `json:"name"`
+			Username  string `json:"username"`
+			ID        int    `json:"id"`
+			State     string `json:"state"`
+			AvatarURL string `json:"avatar_url"`
+			WebURL    string `json:"web_url"`
+		}{
+			Name:      "Venkatesh Thalluri",
+			Username:  "venky333",
+			ID:        1,
+			State:     "active",
+			AvatarURL: "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			WebURL:    "http://gitlab.example.com/venky333",
+		},
+		CreatedAt:     nil,
+		UpdatedAt:     nil,
+		AwardableID:   80,
+		AwardableType: "Issue",
+	}
+
+	ae, resp, err := client.AwardEmoji.GetIssueAwardEmoji(1, 80, 4, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, ae)
+
+	ae, resp, err = client.AwardEmoji.GetIssueAwardEmoji(1.01, 80, 4, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.GetIssueAwardEmoji(1, 80, 4, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.GetIssueAwardEmoji(3, 80, 4, nil)
+	require.Error(t, err)
+	require.Nil(t, ae)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_GetSnippetAwardEmoji(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/snippets/80/award_emoji/4", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodGet)
+		fmt.Fprintf(w, `
+		  {
+			"id": 4,
+			"name": "1234",
+			"user": {
+			  "name": "Venkatesh Thalluri",
+			  "username": "venky333",
+			  "id": 1,
+			  "state": "active",
+			  "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			  "web_url": "http://gitlab.example.com/venky333"
+			},
+			"awardable_id": 80,
+			"awardable_type": "Snippet"
+		  }
+		`)
+	})
+
+	want := &AwardEmoji{
+		ID:   4,
+		Name: "1234",
+		User: struct {
+			Name      string `json:"name"`
+			Username  string `json:"username"`
+			ID        int    `json:"id"`
+			State     string `json:"state"`
+			AvatarURL string `json:"avatar_url"`
+			WebURL    string `json:"web_url"`
+		}{
+			Name:      "Venkatesh Thalluri",
+			Username:  "venky333",
+			ID:        1,
+			State:     "active",
+			AvatarURL: "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			WebURL:    "http://gitlab.example.com/venky333",
+		},
+		CreatedAt:     nil,
+		UpdatedAt:     nil,
+		AwardableID:   80,
+		AwardableType: "Snippet",
+	}
+
+	ae, resp, err := client.AwardEmoji.GetSnippetAwardEmoji(1, 80, 4, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, ae)
+
+	ae, resp, err = client.AwardEmoji.GetSnippetAwardEmoji(1.01, 80, 4, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.GetSnippetAwardEmoji(1, 80, 4, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.GetSnippetAwardEmoji(3, 80, 4, nil)
+	require.Error(t, err)
+	require.Nil(t, ae)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_CreateMergeRequestAwardEmoji(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/merge_requests/80/award_emoji", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodPost)
+		fmt.Fprintf(w, `
+		  {
+			"id": 4,
+			"name": "1234",
+			"user": {
+			  "name": "Venkatesh Thalluri",
+			  "username": "venky333",
+			  "id": 1,
+			  "state": "active",
+			  "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			  "web_url": "http://gitlab.example.com/venky333"
+			},
+			"awardable_id": 80,
+			"awardable_type": "Merge request"
+		  }
+		`)
+	})
+
+	want := &AwardEmoji{
+		ID:   4,
+		Name: "1234",
+		User: struct {
+			Name      string `json:"name"`
+			Username  string `json:"username"`
+			ID        int    `json:"id"`
+			State     string `json:"state"`
+			AvatarURL string `json:"avatar_url"`
+			WebURL    string `json:"web_url"`
+		}{
+			Name:      "Venkatesh Thalluri",
+			Username:  "venky333",
+			ID:        1,
+			State:     "active",
+			AvatarURL: "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			WebURL:    "http://gitlab.example.com/venky333",
+		},
+		CreatedAt:     nil,
+		UpdatedAt:     nil,
+		AwardableID:   80,
+		AwardableType: "Merge request",
+	}
+
+	ae, resp, err := client.AwardEmoji.CreateMergeRequestAwardEmoji(1, 80, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, ae)
+
+	ae, resp, err = client.AwardEmoji.CreateMergeRequestAwardEmoji(1.01, 80, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.CreateMergeRequestAwardEmoji(1, 80, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.CreateMergeRequestAwardEmoji(3, 80, nil)
+	require.Error(t, err)
+	require.Nil(t, ae)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_CreateIssueAwardEmoji(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/issues/80/award_emoji", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodPost)
+		fmt.Fprintf(w, `
+		  {
+			"id": 4,
+			"name": "1234",
+			"user": {
+			  "name": "Venkatesh Thalluri",
+			  "username": "venky333",
+			  "id": 1,
+			  "state": "active",
+			  "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			  "web_url": "http://gitlab.example.com/venky333"
+			},
+			"awardable_id": 80,
+			"awardable_type": "Issue"
+		  }
+		`)
+	})
+
+	want := &AwardEmoji{
+		ID:   4,
+		Name: "1234",
+		User: struct {
+			Name      string `json:"name"`
+			Username  string `json:"username"`
+			ID        int    `json:"id"`
+			State     string `json:"state"`
+			AvatarURL string `json:"avatar_url"`
+			WebURL    string `json:"web_url"`
+		}{
+			Name:      "Venkatesh Thalluri",
+			Username:  "venky333",
+			ID:        1,
+			State:     "active",
+			AvatarURL: "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			WebURL:    "http://gitlab.example.com/venky333",
+		},
+		CreatedAt:     nil,
+		UpdatedAt:     nil,
+		AwardableID:   80,
+		AwardableType: "Issue",
+	}
+
+	ae, resp, err := client.AwardEmoji.CreateIssueAwardEmoji(1, 80, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, ae)
+
+	ae, resp, err = client.AwardEmoji.CreateIssueAwardEmoji(1.01, 80, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.CreateIssueAwardEmoji(1, 80, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.CreateIssueAwardEmoji(3, 80, nil)
+	require.Error(t, err)
+	require.Nil(t, ae)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_CreateSnippetAwardEmoji(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/snippets/80/award_emoji", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodPost)
+		fmt.Fprintf(w, `
+		  {
+			"id": 4,
+			"name": "1234",
+			"user": {
+			  "name": "Venkatesh Thalluri",
+			  "username": "venky333",
+			  "id": 1,
+			  "state": "active",
+			  "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			  "web_url": "http://gitlab.example.com/venky333"
+			},
+			"awardable_id": 80,
+			"awardable_type": "Snippet"
+		  }
+		`)
+	})
+
+	want := &AwardEmoji{
+		ID:   4,
+		Name: "1234",
+		User: struct {
+			Name      string `json:"name"`
+			Username  string `json:"username"`
+			ID        int    `json:"id"`
+			State     string `json:"state"`
+			AvatarURL string `json:"avatar_url"`
+			WebURL    string `json:"web_url"`
+		}{
+			Name:      "Venkatesh Thalluri",
+			Username:  "venky333",
+			ID:        1,
+			State:     "active",
+			AvatarURL: "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			WebURL:    "http://gitlab.example.com/venky333",
+		},
+		CreatedAt:     nil,
+		UpdatedAt:     nil,
+		AwardableID:   80,
+		AwardableType: "Snippet",
+	}
+
+	ae, resp, err := client.AwardEmoji.CreateSnippetAwardEmoji(1, 80, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, ae)
+
+	ae, resp, err = client.AwardEmoji.CreateSnippetAwardEmoji(1.01, 80, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.CreateSnippetAwardEmoji(1, 80, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.CreateSnippetAwardEmoji(3, 80, nil)
+	require.Error(t, err)
+	require.Nil(t, ae)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_DeleteMergeRequestAwardEmoji(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/merge_requests/80/award_emoji/1", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodDelete)
+	})
+
+	resp, err := client.AwardEmoji.DeleteMergeRequestAwardEmoji(1, 80, 1, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+
+	resp, err = client.AwardEmoji.DeleteMergeRequestAwardEmoji(1.01, 80, 1, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+
+	resp, err = client.AwardEmoji.DeleteMergeRequestAwardEmoji(1, 80, 1, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+
+	resp, err = client.AwardEmoji.DeleteMergeRequestAwardEmoji(3, 80, 1, nil)
+	require.Error(t, err)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_DeleteIssueAwardEmoji(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/issues/80/award_emoji/1", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodDelete)
+	})
+
+	resp, err := client.AwardEmoji.DeleteIssueAwardEmoji(1, 80, 1, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+
+	resp, err = client.AwardEmoji.DeleteIssueAwardEmoji(1.01, 80, 1, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+
+	resp, err = client.AwardEmoji.DeleteIssueAwardEmoji(1, 80, 1, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+
+	resp, err = client.AwardEmoji.DeleteIssueAwardEmoji(3, 80, 1, nil)
+	require.Error(t, err)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_DeleteSnippetAwardEmoji(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/snippets/80/award_emoji/1", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodDelete)
+	})
+
+	resp, err := client.AwardEmoji.DeleteSnippetAwardEmoji(1, 80, 1, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+
+	resp, err = client.AwardEmoji.DeleteSnippetAwardEmoji(1.01, 80, 1, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+
+	resp, err = client.AwardEmoji.DeleteSnippetAwardEmoji(1, 80, 1, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+
+	resp, err = client.AwardEmoji.DeleteSnippetAwardEmoji(3, 80, 1, nil)
+	require.Error(t, err)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_ListMergeRequestAwardEmojiOnNote(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/merge_requests/80/notes/1/award_emoji", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodGet)
+		fmt.Fprintf(w, `
+			[
+			  {
+				"id": 4,
+				"name": "1234",
+				"user": {
+				  "name": "Venkatesh Thalluri",
+				  "username": "venky333",
+				  "id": 1,
+				  "state": "active",
+				  "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+				  "web_url": "http://gitlab.example.com/venky333"
+				},
+				"awardable_id": 80,
+				"awardable_type": "Merge request"
+			  }
+			]
+		`)
+	})
+
+	want := []*AwardEmoji{{
+		ID:   4,
+		Name: "1234",
+		User: struct {
+			Name      string `json:"name"`
+			Username  string `json:"username"`
+			ID        int    `json:"id"`
+			State     string `json:"state"`
+			AvatarURL string `json:"avatar_url"`
+			WebURL    string `json:"web_url"`
+		}{
+			Name:      "Venkatesh Thalluri",
+			Username:  "venky333",
+			ID:        1,
+			State:     "active",
+			AvatarURL: "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			WebURL:    "http://gitlab.example.com/venky333",
+		},
+		CreatedAt:     nil,
+		UpdatedAt:     nil,
+		AwardableID:   80,
+		AwardableType: "Merge request",
+	}}
+
+	aes, resp, err := client.AwardEmoji.ListMergeRequestAwardEmojiOnNote(1, 80, 1, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, aes)
+
+	aes, resp, err = client.AwardEmoji.ListMergeRequestAwardEmojiOnNote(1.01, 80, 1, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+	require.Nil(t, aes)
+
+	aes, resp, err = client.AwardEmoji.ListMergeRequestAwardEmojiOnNote(1, 80, 1, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, aes)
+
+	aes, resp, err = client.AwardEmoji.ListMergeRequestAwardEmojiOnNote(3, 80, 1, nil)
+	require.Error(t, err)
+	require.Nil(t, aes)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_ListIssuesAwardEmojiOnNote(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/issues/80/notes/1/award_emoji", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodGet)
+		fmt.Fprintf(w, `
+			[
+			  {
+				"id": 4,
+				"name": "1234",
+				"user": {
+				  "name": "Venkatesh Thalluri",
+				  "username": "venky333",
+				  "id": 1,
+				  "state": "active",
+				  "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+				  "web_url": "http://gitlab.example.com/venky333"
+				},
+				"awardable_id": 80,
+				"awardable_type": "Issue"
+			  }
+			]
+		`)
+	})
+
+	want := []*AwardEmoji{{
+		ID:   4,
+		Name: "1234",
+		User: struct {
+			Name      string `json:"name"`
+			Username  string `json:"username"`
+			ID        int    `json:"id"`
+			State     string `json:"state"`
+			AvatarURL string `json:"avatar_url"`
+			WebURL    string `json:"web_url"`
+		}{
+			Name:      "Venkatesh Thalluri",
+			Username:  "venky333",
+			ID:        1,
+			State:     "active",
+			AvatarURL: "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			WebURL:    "http://gitlab.example.com/venky333",
+		},
+		CreatedAt:     nil,
+		UpdatedAt:     nil,
+		AwardableID:   80,
+		AwardableType: "Issue",
+	}}
+
+	aes, resp, err := client.AwardEmoji.ListIssuesAwardEmojiOnNote(1, 80, 1, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, aes)
+
+	aes, resp, err = client.AwardEmoji.ListIssuesAwardEmojiOnNote(1.01, 80, 1, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+	require.Nil(t, aes)
+
+	aes, resp, err = client.AwardEmoji.ListIssuesAwardEmojiOnNote(1, 80, 1, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, aes)
+
+	aes, resp, err = client.AwardEmoji.ListIssuesAwardEmojiOnNote(3, 80, 1, nil)
+	require.Error(t, err)
+	require.Nil(t, aes)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_ListSnippetAwardEmojiOnNote(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/snippets/80/notes/1/award_emoji", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodGet)
+		fmt.Fprintf(w, `
+			[
+			  {
+				"id": 4,
+				"name": "1234",
+				"user": {
+				  "name": "Venkatesh Thalluri",
+				  "username": "venky333",
+				  "id": 1,
+				  "state": "active",
+				  "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+				  "web_url": "http://gitlab.example.com/venky333"
+				},
+				"awardable_id": 80,
+				"awardable_type": "Snippet"
+			  }
+			]
+		`)
+	})
+
+	want := []*AwardEmoji{{
+		ID:   4,
+		Name: "1234",
+		User: struct {
+			Name      string `json:"name"`
+			Username  string `json:"username"`
+			ID        int    `json:"id"`
+			State     string `json:"state"`
+			AvatarURL string `json:"avatar_url"`
+			WebURL    string `json:"web_url"`
+		}{
+			Name:      "Venkatesh Thalluri",
+			Username:  "venky333",
+			ID:        1,
+			State:     "active",
+			AvatarURL: "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			WebURL:    "http://gitlab.example.com/venky333",
+		},
+		CreatedAt:     nil,
+		UpdatedAt:     nil,
+		AwardableID:   80,
+		AwardableType: "Snippet",
+	}}
+
+	aes, resp, err := client.AwardEmoji.ListSnippetAwardEmojiOnNote(1, 80, 1, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, aes)
+
+	aes, resp, err = client.AwardEmoji.ListSnippetAwardEmojiOnNote(1.01, 80, 1, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+	require.Nil(t, aes)
+
+	aes, resp, err = client.AwardEmoji.ListSnippetAwardEmojiOnNote(1, 80, 1, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, aes)
+
+	aes, resp, err = client.AwardEmoji.ListSnippetAwardEmojiOnNote(3, 80, 1, nil)
+	require.Error(t, err)
+	require.Nil(t, aes)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_GetMergeRequestAwardEmojiOnNote(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/merge_requests/80/notes/1/award_emoji/4", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodGet)
+		fmt.Fprintf(w, `
+		  {
+			"id": 4,
+			"name": "1234",
+			"user": {
+			  "name": "Venkatesh Thalluri",
+			  "username": "venky333",
+			  "id": 1,
+			  "state": "active",
+			  "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			  "web_url": "http://gitlab.example.com/venky333"
+			},
+			"awardable_id": 80,
+			"awardable_type": "Merge request"
+		  }
+		`)
+	})
+
+	want := &AwardEmoji{
+		ID:   4,
+		Name: "1234",
+		User: struct {
+			Name      string `json:"name"`
+			Username  string `json:"username"`
+			ID        int    `json:"id"`
+			State     string `json:"state"`
+			AvatarURL string `json:"avatar_url"`
+			WebURL    string `json:"web_url"`
+		}{
+			Name:      "Venkatesh Thalluri",
+			Username:  "venky333",
+			ID:        1,
+			State:     "active",
+			AvatarURL: "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			WebURL:    "http://gitlab.example.com/venky333",
+		},
+		CreatedAt:     nil,
+		UpdatedAt:     nil,
+		AwardableID:   80,
+		AwardableType: "Merge request",
+	}
+
+	ae, resp, err := client.AwardEmoji.GetMergeRequestAwardEmojiOnNote(1, 80, 1, 4, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, ae)
+
+	ae, resp, err = client.AwardEmoji.GetMergeRequestAwardEmojiOnNote(1.01, 80, 1, 4, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.GetMergeRequestAwardEmojiOnNote(1, 80, 1, 4, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.GetMergeRequestAwardEmojiOnNote(3, 80, 1, 4, nil)
+	require.Error(t, err)
+	require.Nil(t, ae)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_GetIssuesAwardEmojiOnNote(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/issues/80/notes/1/award_emoji/4", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodGet)
+		fmt.Fprintf(w, `
+		  {
+			"id": 4,
+			"name": "1234",
+			"user": {
+			  "name": "Venkatesh Thalluri",
+			  "username": "venky333",
+			  "id": 1,
+			  "state": "active",
+			  "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			  "web_url": "http://gitlab.example.com/venky333"
+			},
+			"awardable_id": 80,
+			"awardable_type": "Issue"
+		  }
+		`)
+	})
+
+	want := &AwardEmoji{
+		ID:   4,
+		Name: "1234",
+		User: struct {
+			Name      string `json:"name"`
+			Username  string `json:"username"`
+			ID        int    `json:"id"`
+			State     string `json:"state"`
+			AvatarURL string `json:"avatar_url"`
+			WebURL    string `json:"web_url"`
+		}{
+			Name:      "Venkatesh Thalluri",
+			Username:  "venky333",
+			ID:        1,
+			State:     "active",
+			AvatarURL: "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			WebURL:    "http://gitlab.example.com/venky333",
+		},
+		CreatedAt:     nil,
+		UpdatedAt:     nil,
+		AwardableID:   80,
+		AwardableType: "Issue",
+	}
+
+	ae, resp, err := client.AwardEmoji.GetIssuesAwardEmojiOnNote(1, 80, 1, 4, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, ae)
+
+	ae, resp, err = client.AwardEmoji.GetIssuesAwardEmojiOnNote(1.01, 80, 1, 4, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.GetIssuesAwardEmojiOnNote(1, 80, 1, 4, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.GetIssuesAwardEmojiOnNote(3, 80, 1, 4, nil)
+	require.Error(t, err)
+	require.Nil(t, ae)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_GetSnippetAwardEmojiOnNote(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/snippets/80/notes/1/award_emoji/4", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodGet)
+		fmt.Fprintf(w, `
+		  {
+			"id": 4,
+			"name": "1234",
+			"user": {
+			  "name": "Venkatesh Thalluri",
+			  "username": "venky333",
+			  "id": 1,
+			  "state": "active",
+			  "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			  "web_url": "http://gitlab.example.com/venky333"
+			},
+			"awardable_id": 80,
+			"awardable_type": "Snippet"
+		  }
+		`)
+	})
+
+	want := &AwardEmoji{
+		ID:   4,
+		Name: "1234",
+		User: struct {
+			Name      string `json:"name"`
+			Username  string `json:"username"`
+			ID        int    `json:"id"`
+			State     string `json:"state"`
+			AvatarURL string `json:"avatar_url"`
+			WebURL    string `json:"web_url"`
+		}{
+			Name:      "Venkatesh Thalluri",
+			Username:  "venky333",
+			ID:        1,
+			State:     "active",
+			AvatarURL: "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			WebURL:    "http://gitlab.example.com/venky333",
+		},
+		CreatedAt:     nil,
+		UpdatedAt:     nil,
+		AwardableID:   80,
+		AwardableType: "Snippet",
+	}
+
+	ae, resp, err := client.AwardEmoji.GetSnippetAwardEmojiOnNote(1, 80, 1, 4, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, ae)
+
+	ae, resp, err = client.AwardEmoji.GetSnippetAwardEmojiOnNote(1.01, 80, 1, 4, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.GetSnippetAwardEmojiOnNote(1, 80, 1, 4, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.GetSnippetAwardEmojiOnNote(3, 80, 1, 4, nil)
+	require.Error(t, err)
+	require.Nil(t, ae)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_CCreateMergeRequestAwardEmojiOnNote(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/merge_requests/80/notes/1/award_emoji", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodPost)
+		fmt.Fprintf(w, `
+		  {
+			"id": 4,
+			"name": "1234",
+			"user": {
+			  "name": "Venkatesh Thalluri",
+			  "username": "venky333",
+			  "id": 1,
+			  "state": "active",
+			  "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			  "web_url": "http://gitlab.example.com/venky333"
+			},
+			"awardable_id": 80,
+			"awardable_type": "Merge request"
+		  }
+		`)
+	})
+
+	want := &AwardEmoji{
+		ID:   4,
+		Name: "1234",
+		User: struct {
+			Name      string `json:"name"`
+			Username  string `json:"username"`
+			ID        int    `json:"id"`
+			State     string `json:"state"`
+			AvatarURL string `json:"avatar_url"`
+			WebURL    string `json:"web_url"`
+		}{
+			Name:      "Venkatesh Thalluri",
+			Username:  "venky333",
+			ID:        1,
+			State:     "active",
+			AvatarURL: "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			WebURL:    "http://gitlab.example.com/venky333",
+		},
+		CreatedAt:     nil,
+		UpdatedAt:     nil,
+		AwardableID:   80,
+		AwardableType: "Merge request",
+	}
+
+	ae, resp, err := client.AwardEmoji.CreateMergeRequestAwardEmojiOnNote(1, 80, 1, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, ae)
+
+	ae, resp, err = client.AwardEmoji.CreateMergeRequestAwardEmojiOnNote(1.01, 80, 1, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.CreateMergeRequestAwardEmojiOnNote(1, 80, 1, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.CreateMergeRequestAwardEmojiOnNote(3, 80, 1, nil)
+	require.Error(t, err)
+	require.Nil(t, ae)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_CreateIssuesAwardEmojiOnNote(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/issues/80/notes/1/award_emoji", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodPost)
+		fmt.Fprintf(w, `
+		  {
+			"id": 4,
+			"name": "1234",
+			"user": {
+			  "name": "Venkatesh Thalluri",
+			  "username": "venky333",
+			  "id": 1,
+			  "state": "active",
+			  "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			  "web_url": "http://gitlab.example.com/venky333"
+			},
+			"awardable_id": 80,
+			"awardable_type": "Issue"
+		  }
+		`)
+	})
+
+	want := &AwardEmoji{
+		ID:   4,
+		Name: "1234",
+		User: struct {
+			Name      string `json:"name"`
+			Username  string `json:"username"`
+			ID        int    `json:"id"`
+			State     string `json:"state"`
+			AvatarURL string `json:"avatar_url"`
+			WebURL    string `json:"web_url"`
+		}{
+			Name:      "Venkatesh Thalluri",
+			Username:  "venky333",
+			ID:        1,
+			State:     "active",
+			AvatarURL: "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			WebURL:    "http://gitlab.example.com/venky333",
+		},
+		CreatedAt:     nil,
+		UpdatedAt:     nil,
+		AwardableID:   80,
+		AwardableType: "Issue",
+	}
+
+	ae, resp, err := client.AwardEmoji.CreateIssuesAwardEmojiOnNote(1, 80, 1, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, ae)
+
+	ae, resp, err = client.AwardEmoji.CreateIssuesAwardEmojiOnNote(1.01, 80, 1, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.CreateIssuesAwardEmojiOnNote(1, 80, 1, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.CreateIssuesAwardEmojiOnNote(3, 80, 1, nil)
+	require.Error(t, err)
+	require.Nil(t, ae)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_CreateSnippetAwardEmojiOnNote(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/snippets/80/notes/1/award_emoji", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodPost)
+		fmt.Fprintf(w, `
+		  {
+			"id": 4,
+			"name": "1234",
+			"user": {
+			  "name": "Venkatesh Thalluri",
+			  "username": "venky333",
+			  "id": 1,
+			  "state": "active",
+			  "avatar_url": "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			  "web_url": "http://gitlab.example.com/venky333"
+			},
+			"awardable_id": 80,
+			"awardable_type": "Snippet"
+		  }
+		`)
+	})
+
+	want := &AwardEmoji{
+		ID:   4,
+		Name: "1234",
+		User: struct {
+			Name      string `json:"name"`
+			Username  string `json:"username"`
+			ID        int    `json:"id"`
+			State     string `json:"state"`
+			AvatarURL string `json:"avatar_url"`
+			WebURL    string `json:"web_url"`
+		}{
+			Name:      "Venkatesh Thalluri",
+			Username:  "venky333",
+			ID:        1,
+			State:     "active",
+			AvatarURL: "http://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon",
+			WebURL:    "http://gitlab.example.com/venky333",
+		},
+		CreatedAt:     nil,
+		UpdatedAt:     nil,
+		AwardableID:   80,
+		AwardableType: "Snippet",
+	}
+
+	ae, resp, err := client.AwardEmoji.CreateSnippetAwardEmojiOnNote(1, 80, 1, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+	require.Equal(t, want, ae)
+
+	ae, resp, err = client.AwardEmoji.CreateSnippetAwardEmojiOnNote(1.01, 80, 1, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.CreateSnippetAwardEmojiOnNote(1, 80, 1, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+	require.Nil(t, ae)
+
+	ae, resp, err = client.AwardEmoji.CreateSnippetAwardEmojiOnNote(3, 80, 1, nil)
+	require.Error(t, err)
+	require.Nil(t, ae)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_DeleteMergeRequestAwardEmojiOnNote(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/merge_requests/80/notes/1/award_emoji/1", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodDelete)
+	})
+
+	resp, err := client.AwardEmoji.DeleteMergeRequestAwardEmojiOnNote(1, 80, 1, 1, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+
+	resp, err = client.AwardEmoji.DeleteMergeRequestAwardEmojiOnNote(1.01, 80, 1, 1, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+
+	resp, err = client.AwardEmoji.DeleteMergeRequestAwardEmojiOnNote(1, 80, 1, 1, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+
+	resp, err = client.AwardEmoji.DeleteMergeRequestAwardEmojiOnNote(3, 80, 1, 1, nil)
+	require.Error(t, err)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_DeleteIssuesAwardEmojiOnNote(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/issues/80/notes/1/award_emoji/1", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodDelete)
+	})
+
+	resp, err := client.AwardEmoji.DeleteIssuesAwardEmojiOnNote(1, 80, 1, 1, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+
+	resp, err = client.AwardEmoji.DeleteIssuesAwardEmojiOnNote(1.01, 80, 1, 1, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+
+	resp, err = client.AwardEmoji.DeleteIssuesAwardEmojiOnNote(1, 80, 1, 1, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+
+	resp, err = client.AwardEmoji.DeleteIssuesAwardEmojiOnNote(3, 80, 1, 1, nil)
+	require.Error(t, err)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
+
+func TestAwardEmojiService_DeleteSnippetAwardEmojiOnNote(t *testing.T) {
+	mux, server, client := setup(t)
+	defer teardown(server)
+
+	mux.HandleFunc("/api/v4/projects/1/snippets/80/notes/1/award_emoji/1", func(w http.ResponseWriter, r *http.Request) {
+		testMethod(t, r, http.MethodDelete)
+	})
+
+	resp, err := client.AwardEmoji.DeleteSnippetAwardEmojiOnNote(1, 80, 1, 1, nil)
+	require.NoError(t, err)
+	require.NotNil(t, resp)
+
+	resp, err = client.AwardEmoji.DeleteSnippetAwardEmojiOnNote(1.01, 80, 1, 1, nil)
+	require.EqualError(t, err, "invalid ID type 1.01, the ID must be an int or a string")
+	require.Nil(t, resp)
+
+	resp, err = client.AwardEmoji.DeleteSnippetAwardEmojiOnNote(1, 80, 1, 1, nil, errorOption)
+	require.EqualError(t, err, "RequestOptionFunc returns an error")
+	require.Nil(t, resp)
+
+	resp, err = client.AwardEmoji.DeleteSnippetAwardEmojiOnNote(3, 80, 1, 1, nil)
+	require.Error(t, err)
+	require.Equal(t, http.StatusNotFound, resp.StatusCode)
+}
diff --git a/event_webhook_types_test.go b/event_webhook_types_test.go
index 9fd059b..d9b5d49 100644
--- a/event_webhook_types_test.go
+++ b/event_webhook_types_test.go
@@ -312,10 +312,6 @@ func TestPipelineEventUnmarshal(t *testing.T) {
 		t.Errorf("ObjectAttributes.QueuedDuration is %v, want %v", event.ObjectAttributes.QueuedDuration, 12)
 	}
 
-	if event.ObjectAttributes.Variables[0].Key != "NESTOR_PROD_ENVIRONMENT" {
-		t.Errorf("ObjectAttributes.Variables[0].Key is %v, want %v", event.ObjectAttributes.Variables[0].Key, "NESTOR_PROD_ENVIRONMENT")
-	}
-
 	if event.User.ID != 42 {
 		t.Errorf("User ID is %d, want %d", event.User.ID, 42)
 	}