Skip to content

Commit

Permalink
Merge pull request #79 from Neur0toxine/update-test-json-scanner
Browse files Browse the repository at this point in the history
update record scanner for tests
  • Loading branch information
Neur0toxine authored Sep 26, 2024
2 parents e278ba5 + 10f8f64 commit 78fadaa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/util/testutil/json_record_scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import (
type LogRecord struct {
LevelName string `json:"level_name"`
DateTime null.Time `json:"datetime"`
Caller string `json:"caller"`
Message string `json:"message"`
Handler string `json:"handler,omitempty"`
Connection string `json:"connection,omitempty"`
Account string `json:"account,omitempty"`
StreamID string `json:"streamId"`
Context map[string]interface{} `json:"context,omitempty"`
}

Expand Down
4 changes: 2 additions & 2 deletions core/util/testutil/json_record_scanner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func (t *JSONRecordScannerTest) newPredefined() *JSONRecordScanner {
return t.new([]string{strings.ReplaceAll(`{
"level_name": "ERROR",
"datetime": "2024-06-07T13:49:17+03:00",
"caller": "handlers/account_middleware.go:147",
"streamId": "1",
"message": "Cannot add account",
"handler": "handlers.addAccount",
"connection": "https://fake-uri.retailcrm.pro",
Expand All @@ -44,7 +44,7 @@ func (t *JSONRecordScannerTest) assertPredefined(record LogRecord) {
t.Assert().True(record.DateTime.Valid)
t.Assert().Equal(ts, record.DateTime.Time)
t.Assert().Equal("ERROR", record.LevelName)
t.Assert().Equal("handlers/account_middleware.go:147", record.Caller)
t.Assert().Equal("1", record.StreamID)
t.Assert().Equal("Cannot add account", record.Message)
t.Assert().Equal("handlers.addAccount", record.Handler)
t.Assert().Equal("https://fake-uri.retailcrm.pro", record.Connection)
Expand Down

0 comments on commit 78fadaa

Please sign in to comment.