### Question:
AlertsGenerationIntentService extends RoboIntentService { @Override protected void onHandleIntent(Intent intent) { i("Alert", "Generating alerts"); alertsService.updateLowStockAlerts(); alertsService.generateRoutineOrderAlert(new Date()); alertsService.generateAllocationAlerts(); alertsService.generateMonthlyStockCountAlerts(new Date()); } AlertsGenerationIntentService();   }### Answer:
@Test public void shouldUpdateLowStockAlerts() throws Exception { AlertsGenerationIntentServiceMock alertsGenerationIntentService = new AlertsGenerationIntentServiceMock(); alertsGenerationIntentService.onCreate(); alertsGenerationIntentService.onHandleIntent(null); verify(alertService).updateLowStockAlerts(); }
@Test public void shouldGenerateRoutineOrderAlerts() throws Exception { AlertsGenerationIntentServiceMock alertsGenerationIntentService = new AlertsGenerationIntentServiceMock(); alertsGenerationIntentService.onCreate(); alertsGenerationIntentService.onHandleIntent(null); verify(alertService).generateRoutineOrderAlert((java.util.Date) any()); }
@Test public void shouldGenerateAllocationAlerts() throws Exception { AlertsGenerationIntentServiceMock alertsGenerationIntentService = new AlertsGenerationIntentServiceMock(); alertsGenerationIntentService.onCreate(); alertsGenerationIntentService.onHandleIntent(null); verify(alertService).generateAllocationAlerts(); }
@Test public void shouldGenerateMonthlyStockCountAlerts() throws Exception { AlertsGenerationIntentServiceMock alertsGenerationIntentService = new AlertsGenerationIntentServiceMock(); alertsGenerationIntentService.onCreate(); alertsGenerationIntentService.onHandleIntent(null); verify(alertService).generateMonthlyStockCountAlerts((java.util.Date) any()); }