mirror of
https://github.com/mariocandela/beelzebub.git
synced 2025-07-01 18:47:26 -04:00
Fixed Unit Test
This commit is contained in:
1
go.mod
1
go.mod
@ -6,6 +6,7 @@ require (
|
|||||||
github.com/gliderlabs/ssh v0.3.3 // indirect
|
github.com/gliderlabs/ssh v0.3.3 // indirect
|
||||||
github.com/google/uuid v1.3.0 // indirect
|
github.com/google/uuid v1.3.0 // indirect
|
||||||
github.com/sirupsen/logrus v1.8.1
|
github.com/sirupsen/logrus v1.8.1
|
||||||
|
github.com/stretchr/testify v1.6.1 // indirect
|
||||||
go.mongodb.org/mongo-driver v1.9.1 // indirect
|
go.mongodb.org/mongo-driver v1.9.1 // indirect
|
||||||
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e // indirect
|
golang.org/x/crypto v0.0.0-20210616213533-5ff15b29337e // indirect
|
||||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect
|
||||||
|
@ -13,7 +13,10 @@ core:
|
|||||||
debug: false
|
debug: false
|
||||||
debugReportCaller: false
|
debugReportCaller: false
|
||||||
logDisableTimestamp: true
|
logDisableTimestamp: true
|
||||||
logsPath: ./logs`)
|
logsPath: ./logs
|
||||||
|
tracing:
|
||||||
|
mongoEnabled: true
|
||||||
|
mongoURI: provaMock`)
|
||||||
return configurationsCoreBytes, nil
|
return configurationsCoreBytes, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,6 +80,8 @@ func TestReadConfigurationsCoreValid(t *testing.T) {
|
|||||||
assert.Equal(t, coreConfigurations.Core.Logging.LogDisableTimestamp, true)
|
assert.Equal(t, coreConfigurations.Core.Logging.LogDisableTimestamp, true)
|
||||||
assert.Equal(t, coreConfigurations.Core.Logging.DebugReportCaller, false)
|
assert.Equal(t, coreConfigurations.Core.Logging.DebugReportCaller, false)
|
||||||
assert.Equal(t, coreConfigurations.Core.Logging.LogsPath, "./logs")
|
assert.Equal(t, coreConfigurations.Core.Logging.LogsPath, "./logs")
|
||||||
|
assert.Equal(t, coreConfigurations.Core.Tracing.MongoEnabled, true)
|
||||||
|
assert.Equal(t, coreConfigurations.Core.Tracing.MongoURI, "provaMock")
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestReadConfigurationsServicesFail(t *testing.T) {
|
func TestReadConfigurationsServicesFail(t *testing.T) {
|
||||||
|
@ -24,14 +24,14 @@ func TestTraceEvent(t *testing.T) {
|
|||||||
|
|
||||||
tracer.TraceEvent(Event{
|
tracer.TraceEvent(Event{
|
||||||
ID: "mockID",
|
ID: "mockID",
|
||||||
Protocol: HTTP,
|
Protocol: HTTP.String(),
|
||||||
Status: Stateless,
|
Status: Stateless.String(),
|
||||||
})
|
})
|
||||||
|
|
||||||
assert.NotNil(t, eventCalled.ID)
|
assert.NotNil(t, eventCalled.ID)
|
||||||
assert.Equal(t, eventCalled.ID, "mockID")
|
assert.Equal(t, eventCalled.ID, "mockID")
|
||||||
assert.Equal(t, eventCalled.Protocol, HTTP)
|
assert.Equal(t, eventCalled.Protocol, HTTP.String())
|
||||||
assert.Equal(t, eventCalled.Status, Stateless)
|
assert.Equal(t, eventCalled.Status, Stateless.String())
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestStringStatus(t *testing.T) {
|
func TestStringStatus(t *testing.T) {
|
||||||
|
Reference in New Issue
Block a user