Add Sender module

This commit is contained in:
David Stotijn
2022-02-22 14:10:39 +01:00
parent afa211d0ec
commit efc20564c1
58 changed files with 9131 additions and 282 deletions

View File

@ -34,7 +34,7 @@ func TestRequestModifier(t *testing.T) {
Repository: repoMock,
Scope: &scope.Scope{},
})
svc.ActiveProjectID = ulid.MustNew(ulid.Timestamp(time.Now()), ulidEntropy)
svc.SetActiveProjectID(ulid.MustNew(ulid.Timestamp(time.Now()), ulidEntropy))
next := func(req *http.Request) {
req.Body = io.NopCloser(strings.NewReader("modified body"))
@ -52,7 +52,7 @@ func TestRequestModifier(t *testing.T) {
exp := reqlog.RequestLog{
ID: ulid.ULID{}, // Empty value
ProjectID: svc.ActiveProjectID,
ProjectID: svc.ActiveProjectID(),
Method: req.Method,
URL: req.URL,
Proto: req.Proto,
@ -78,7 +78,7 @@ func TestResponseModifier(t *testing.T) {
svc := reqlog.NewService(reqlog.Config{
Repository: repoMock,
})
svc.ActiveProjectID = ulid.MustNew(ulid.Timestamp(time.Now()), ulidEntropy)
svc.SetActiveProjectID(ulid.MustNew(ulid.Timestamp(time.Now()), ulidEntropy))
next := func(res *http.Response) error {
res.Body = io.NopCloser(strings.NewReader("modified body"))