@@ -2,7 +2,6 @@ package don_test
22
33import (
44 "context"
5- "net/http"
65 "testing"
76
87 "github.com/abemedia/go-don"
@@ -32,7 +31,7 @@ func TestHandler(t *testing.T) {
3231 {
3332 message : "should return no content" ,
3433 expected : response {
35- Code : http .StatusNoContent ,
34+ Code : fasthttp .StatusNoContent ,
3635 Body : "" ,
3736 Header : map [string ]string {
3837 "Content-Length" : "0" ,
@@ -47,7 +46,7 @@ func TestHandler(t *testing.T) {
4746 {
4847 message : "should return null" ,
4948 expected : response {
50- Code : http .StatusOK ,
49+ Code : fasthttp .StatusOK ,
5150 Body : "null\n " ,
5251 Header : map [string ]string {
5352 "Content-Length" : "0" ,
@@ -62,7 +61,7 @@ func TestHandler(t *testing.T) {
6261 {
6362 message : "should JSON encode map" ,
6463 expected : response {
65- Code : http .StatusOK ,
64+ Code : fasthttp .StatusOK ,
6665 Body : `{"foo":"bar"}` + "\n " ,
6766 Header : map [string ]string {"Content-Type" : "application/json; charset=utf-8" },
6867 },
@@ -74,7 +73,7 @@ func TestHandler(t *testing.T) {
7473 {
7574 message : "should return error on unprocessable request" ,
7675 expected : response {
77- Code : http .StatusUnsupportedMediaType ,
76+ Code : fasthttp .StatusUnsupportedMediaType ,
7877 Body : "Unsupported Media Type\n " ,
7978 Header : map [string ]string {"Content-Type" : "text/plain; charset=utf-8" },
8079 },
@@ -87,8 +86,8 @@ func TestHandler(t *testing.T) {
8786 {
8887 message : "should return error on unacceptable" ,
8988 expected : response {
90- Code : http .StatusNotAcceptable ,
91- Body : "Not Acceptable" ,
89+ Code : fasthttp .StatusNotAcceptable ,
90+ Body : "Not Acceptable\n " ,
9291 Header : map [string ]string {"Content-Type" : "text/plain; charset=utf-8" },
9392 },
9493 config : & don.Config {DefaultEncoding : "text/plain" },
@@ -100,8 +99,8 @@ func TestHandler(t *testing.T) {
10099 {
101100 message : "should return error on unsupported accept" ,
102101 expected : response {
103- Code : http .StatusNotAcceptable ,
104- Body : "Not Acceptable" ,
102+ Code : fasthttp .StatusNotAcceptable ,
103+ Body : "Not Acceptable\n " ,
105104 Header : map [string ]string {"Content-Type" : "text/plain; charset=utf-8" },
106105 },
107106 config : & don.Config {DefaultEncoding : "text/plain" },
@@ -113,7 +112,7 @@ func TestHandler(t *testing.T) {
113112 {
114113 message : "should return error on unsupported content type" ,
115114 expected : response {
116- Code : http .StatusUnsupportedMediaType ,
115+ Code : fasthttp .StatusUnsupportedMediaType ,
117116 Body : "Unsupported Media Type\n " ,
118117 Header : map [string ]string {"Content-Type" : "text/plain; charset=utf-8" },
119118 },
@@ -127,7 +126,7 @@ func TestHandler(t *testing.T) {
127126 {
128127 message : "should read text request" ,
129128 expected : response {
130- Code : http .StatusOK ,
129+ Code : fasthttp .StatusOK ,
131130 Body : "foo\n " ,
132131 Header : map [string ]string {"Content-Type" : "text/plain; charset=utf-8" },
133132 },
0 commit comments