mirror of
https://github.com/retailcrm/mg-transport-core.git
synced 2024-11-22 05:06:04 +03:00
update record scanner for tests
This commit is contained in:
parent
e278ba58cd
commit
10f8f64c6a
@ -11,11 +11,11 @@ import (
|
|||||||
type LogRecord struct {
|
type LogRecord struct {
|
||||||
LevelName string `json:"level_name"`
|
LevelName string `json:"level_name"`
|
||||||
DateTime null.Time `json:"datetime"`
|
DateTime null.Time `json:"datetime"`
|
||||||
Caller string `json:"caller"`
|
|
||||||
Message string `json:"message"`
|
Message string `json:"message"`
|
||||||
Handler string `json:"handler,omitempty"`
|
Handler string `json:"handler,omitempty"`
|
||||||
Connection string `json:"connection,omitempty"`
|
Connection string `json:"connection,omitempty"`
|
||||||
Account string `json:"account,omitempty"`
|
Account string `json:"account,omitempty"`
|
||||||
|
StreamID string `json:"streamId"`
|
||||||
Context map[string]interface{} `json:"context,omitempty"`
|
Context map[string]interface{} `json:"context,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ func (t *JSONRecordScannerTest) newPredefined() *JSONRecordScanner {
|
|||||||
return t.new([]string{strings.ReplaceAll(`{
|
return t.new([]string{strings.ReplaceAll(`{
|
||||||
"level_name": "ERROR",
|
"level_name": "ERROR",
|
||||||
"datetime": "2024-06-07T13:49:17+03:00",
|
"datetime": "2024-06-07T13:49:17+03:00",
|
||||||
"caller": "handlers/account_middleware.go:147",
|
"streamId": "1",
|
||||||
"message": "Cannot add account",
|
"message": "Cannot add account",
|
||||||
"handler": "handlers.addAccount",
|
"handler": "handlers.addAccount",
|
||||||
"connection": "https://fake-uri.retailcrm.pro",
|
"connection": "https://fake-uri.retailcrm.pro",
|
||||||
@ -44,7 +44,7 @@ func (t *JSONRecordScannerTest) assertPredefined(record LogRecord) {
|
|||||||
t.Assert().True(record.DateTime.Valid)
|
t.Assert().True(record.DateTime.Valid)
|
||||||
t.Assert().Equal(ts, record.DateTime.Time)
|
t.Assert().Equal(ts, record.DateTime.Time)
|
||||||
t.Assert().Equal("ERROR", record.LevelName)
|
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("Cannot add account", record.Message)
|
||||||
t.Assert().Equal("handlers.addAccount", record.Handler)
|
t.Assert().Equal("handlers.addAccount", record.Handler)
|
||||||
t.Assert().Equal("https://fake-uri.retailcrm.pro", record.Connection)
|
t.Assert().Equal("https://fake-uri.retailcrm.pro", record.Connection)
|
||||||
|
Loading…
Reference in New Issue
Block a user