Skip to content

Commit

Permalink
test: add test case
Browse files Browse the repository at this point in the history
testcases for testing post
request and response & empty
response and request logging
  • Loading branch information
rohanraj7316 committed May 29, 2022
1 parent c669fe0 commit 02071b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion examples/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func (h *Handler) Get(ctx context.Context) {
func (h *Handler) Post(ctx context.Context) {
url := "https://httpbin.org/anything"
header := map[string]string{
"content-type": "application/json",
"Content-Type": "application/json",
}

body := map[string]string{
Expand Down
3 changes: 3 additions & 0 deletions httpclient_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"io"
"net/http"
"testing"
"time"

"github.com/google/uuid"
)
Expand Down Expand Up @@ -108,6 +109,8 @@ func TestRequestLogging(t *testing.T) {
if err != nil {
t.Error(err)
}

time.Sleep(3 * time.Second)
}

func TestHttpPostMethod(t *testing.T) {
Expand Down

0 comments on commit 02071b0

Please sign in to comment.