use of eu.bcvsolutions.idm.core.monitoring.api.dto.IdmMonitoringResultDto in project CzechIdMng by bcvsolutions.
the class LoggingEventMonitoringEvaluatorUnitTest method testErrorWithNumberOfDays.
@Test
public void testErrorWithNumberOfDays() {
Mockito.when(loggingEventService.count(ArgumentMatchers.any())).thenReturn(10L);
//
IdmMonitoringDto monitoring = new IdmMonitoringDto();
monitoring.setInstanceId("mock");
monitoring.getEvaluatorProperties().put(AbstractDailyMonitoringEvaluator.PARAMETER_NUMBER_OF_DAYS, 2);
IdmMonitoringResultDto result = evaluator.evaluate(monitoring);
//
Assert.assertEquals(CoreResultCode.MONITORING_LOGGING_EVENT_ERROR.getCode(), result.getResult().getCode());
Assert.assertNull(result.getLevel());
}
use of eu.bcvsolutions.idm.core.monitoring.api.dto.IdmMonitoringResultDto in project CzechIdMng by bcvsolutions.
the class LoggingEventMonitoringEvaluatorUnitTest method testOk.
@Test
public void testOk() {
Mockito.when(loggingEventService.count(ArgumentMatchers.any())).thenReturn(0L);
//
IdmMonitoringDto monitoring = new IdmMonitoringDto();
monitoring.setInstanceId("mock");
monitoring.getEvaluatorProperties().put(AbstractDailyMonitoringEvaluator.PARAMETER_NUMBER_OF_DAYS, 2);
IdmMonitoringResultDto result = evaluator.evaluate(monitoring);
//
Assert.assertEquals(CoreResultCode.OK.getCode(), result.getResult().getCode());
}
use of eu.bcvsolutions.idm.core.monitoring.api.dto.IdmMonitoringResultDto in project CzechIdMng by bcvsolutions.
the class LongRunningTaskMonitoringEvaluatorUnitTest method testError.
@Test
public void testError() {
Mockito.when(longRunningTaskService.count(ArgumentMatchers.any())).thenReturn(10L);
//
IdmMonitoringDto monitoring = new IdmMonitoringDto();
monitoring.setInstanceId("mock");
IdmMonitoringResultDto result = evaluator.evaluate(monitoring);
//
Assert.assertEquals(CoreResultCode.MONITORING_LONG_RUNNING_TASK_ERROR.getCode(), result.getResult().getCode());
Assert.assertNull(result.getLevel());
}
use of eu.bcvsolutions.idm.core.monitoring.api.dto.IdmMonitoringResultDto in project CzechIdMng by bcvsolutions.
the class LongRunningTaskMonitoringEvaluatorUnitTest method testErrorWithNumberOfDays.
@Test
public void testErrorWithNumberOfDays() {
Mockito.when(longRunningTaskService.count(ArgumentMatchers.any())).thenReturn(10L);
//
IdmMonitoringDto monitoring = new IdmMonitoringDto();
monitoring.setInstanceId("mock");
monitoring.getEvaluatorProperties().put(AbstractDailyMonitoringEvaluator.PARAMETER_NUMBER_OF_DAYS, 2);
IdmMonitoringResultDto result = evaluator.evaluate(monitoring);
//
Assert.assertEquals(CoreResultCode.MONITORING_LONG_RUNNING_TASK_ERROR.getCode(), result.getResult().getCode());
Assert.assertNull(result.getLevel());
}
use of eu.bcvsolutions.idm.core.monitoring.api.dto.IdmMonitoringResultDto in project CzechIdMng by bcvsolutions.
the class LongRunningTaskMonitoringEvaluatorUnitTest method testOk.
@Test
public void testOk() {
Mockito.when(longRunningTaskService.count(ArgumentMatchers.any())).thenReturn(0L);
//
IdmMonitoringDto monitoring = new IdmMonitoringDto();
monitoring.setInstanceId("mock");
monitoring.getEvaluatorProperties().put(AbstractDailyMonitoringEvaluator.PARAMETER_NUMBER_OF_DAYS, 2);
IdmMonitoringResultDto result = evaluator.evaluate(monitoring);
//
Assert.assertEquals(CoreResultCode.OK.getCode(), result.getResult().getCode());
}
Aggregations