fix tests for cloudwatch logs
@@ -89,8 +89,10 @@ func Test_cloudwatchLogsPlugin_run(t *testing.T) {
defer os.Remove(file.Name())
p := &cloudwatchLogsPlugin{
Service: createMockService(),
- LogGroupName: "test-group",
StateFile: file.Name(),
+ logOpts: &logOpts{
+ LogGroupName: "test-group",
+ },
}
messages, err := p.run()
assert.Equal(t, err, nil, "err should be nil")
@@ -155,10 +157,12 @@ func Test_cloudwatchLogsPlugin_check(t *testing.T) {
}
for _, testCase := range testCases {
p := &cloudwatchLogsPlugin{
+ logOpts: &logOpts{
CriticalOver: testCase.CriticalOver,
WarningOver: testCase.WarningOver,
Pattern: testCase.Pattern,
ReturnContent: testCase.ReturnContent,
+ },
}
res := p.check(testCase.Messages)
assert.Equal(t, res.Status, testCase.Status)
