@Test public void testCreateByAlarmCallbackConfiguration() throws Exception { AlarmCallbackConfiguration configuration = mock(AlarmCallbackConfiguration.class); when(configuration.getType()).thenReturn(DummyAlarmCallback.class.getCanonicalName()); AlarmCallback alarmCallback = alarmCallbackFactory.create(configuration); assertNotNull(alarmCallback); assertTrue(alarmCallback instanceof DummyAlarmCallback); assertEquals(dummyAlarmCallback, alarmCallback); }
public static AlarmCallbackHistory create( String id, AlarmCallbackConfiguration alarmCallbackConfiguration, Alert alert, AlertCondition alertCondition, AlarmCallbackResult result, DateTime createdAt) { final AlarmCallbackSummary alarmCallbackSummary = AlarmCallbackSummary.create( alarmCallbackConfiguration.getId(), alarmCallbackConfiguration.getStreamId(), alarmCallbackConfiguration.getType(), alarmCallbackConfiguration.getTitle(), alarmCallbackConfiguration.getConfiguration(), alarmCallbackConfiguration.getCreatedAt(), alarmCallbackConfiguration.getCreatorUserId()); return create( id, alarmCallbackSummary, alert.getId(), alertCondition.getId(), result, createdAt); }