Skip to content

Commit

Permalink
Merge branch 'develop' into 'master'
Browse files Browse the repository at this point in the history
Generated webhook requests now have no errors set (errors=nil).

See merge request ccc/team-rundmc/whatsapp-components/whatsapp-business-api-mock!5
  • Loading branch information
ron96G committed Jul 23, 2021
2 parents 7d98af0 + 655601e commit 3b22bd4
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 213 deletions.
2 changes: 1 addition & 1 deletion controller/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ func (wc *WebhookConfig) GenerateWebhookRequests(numberOfEntries int, types ...s
}
whReq.Messages = append(whReq.Messages, messages...)
whReq.Contacts = append(whReq.Contacts, wc.Generators.Contacts...)
whReq.Errors = append(whReq.Errors, nil)
whReq.Errors = nil // Set the errors array to nil to skip it in marshalling
whReq.Statuses = wc.StatusQueue
wc.StatusQueue = []*model.Status{}
wc.Queue <- whReq
Expand Down
211 changes: 0 additions & 211 deletions test/certificate.go

This file was deleted.

5 changes: 5 additions & 0 deletions test/go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module test/webhook

go 1.16

require github.com/ron96G/go-certificate-util v0.1.0
10 changes: 10 additions & 0 deletions test/go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
github.com/ron96G/go-certificate-util v0.1.0 h1:8pzRt+NAr8T3PuPNae8dVWYalEQzWxecyAV/3WtBPkg=
github.com/ron96G/go-certificate-util v0.1.0/go.mod h1:EKfguL+zEJk/8NLD7EIFKYbUa+jzoJr/gCThcdXpNso=
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97 h1:/UOmuWzQfxxo9UtlXMwuQU8CMgg1eZXqTRwkSQJWKOI=
golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
Binary file removed test/test
Binary file not shown.
4 changes: 3 additions & 1 deletion test/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import (
"io/ioutil"
"net/http"
"strings"

"github.com/ron96G/go-certificate-util/util"
)

func webhook(w http.ResponseWriter, r *http.Request) {
Expand All @@ -29,7 +31,7 @@ func webhook(w http.ResponseWriter, r *http.Request) {

func main() {
http.HandleFunc("/webhook", webhook)
s, _ := GenerateServerTLS()
s, _ := util.GenerateServerTLS(util.Options{})
l, _ := tls.Listen("tcp", "0.0.0.0:9000", s)
http.Serve(l, nil)
}

0 comments on commit 3b22bd4

Please sign in to comment.