diff --git a/config/job_config_validator_test.go b/config/job_config_validator_test.go index 2aee6d0..bcf338a 100644 --- a/config/job_config_validator_test.go +++ b/config/job_config_validator_test.go @@ -11,14 +11,21 @@ import ( ) func TestJobConfig_Validate_Disabled(t *testing.T) { - logger, _ := mocklogger.HijackOutput(logrus.New()) + logger, buff := mocklogger.HijackOutput(logrus.New()) log := logrus.NewEntry(logger) jobConfig := &config.JobConfig{ - Disabled: true, + Disabled: true, + Name: "Test", + Concurrency: 35, + Tasks: []config.Task{{}}, + Events: []config.JobEvent{ + {Interval: -1}, // Invalid interval + }, } err := jobConfig.Validate(log) assert.NoError(t, err, "Expected no error when job is disabled") + assert.Contains(t, buff.String(), "JobConfig Test is disabled") } func TestJobConfig_Validate_Events(t *testing.T) { diff --git a/logger/mock_logger/mock_logger.go b/logger/mock_logger/mock_logger.go index 3f90cfd..dec7346 100644 --- a/logger/mock_logger/mock_logger.go +++ b/logger/mock_logger/mock_logger.go @@ -8,6 +8,7 @@ import ( func HijackOutput(log *logrus.Logger) (*logrus.Logger, *bytes.Buffer) { buffer := bytes.NewBuffer([]byte{}) + log.SetLevel(logrus.TraceLevel) log.SetOutput(buffer) return log, buffer }