@Test void testNoIndexActionsForTransaction() { mockGetAllIndexActions(empty()); indexJobService.executeJob(progress, transactionId); verify(progress).status("No index actions found for transaction id: [aabbcc]"); verify(indexService, never()).refreshIndex(); }
@Timed( value = "service.index", description = "Timing information for the index service.", histogram = true) public Void executeJob(Progress progress, String transactionId) { requireNonNull(progress); IndexActionGroup indexActionGroup = dataService.findOneById(INDEX_ACTION_GROUP, transactionId, IndexActionGroup.class); if (indexActionGroup != null && indexActionGroup.getCount() > 0) { progress.setProgressMax(indexActionGroup.getCount()); progress.status(format("Start indexing for transaction id: [{0}]", transactionId)); performIndexActions(progress, transactionId); progress.status(format("Finished indexing for transaction id: [{0}]", transactionId)); } else { progress.status(format("No index actions found for transaction id: [{0}]", transactionId)); } return null; }
IndexJobService { @Timed( value = "service.index", description = "Timing information for the index service.", histogram = true) public Void executeJob(Progress progress, String transactionId) { requireNonNull(progress); IndexActionGroup indexActionGroup = dataService.findOneById(INDEX_ACTION_GROUP, transactionId, IndexActionGroup.class); if (indexActionGroup != null && indexActionGroup.getCount() > 0) { progress.setProgressMax(indexActionGroup.getCount()); progress.status(format("Start indexing for transaction id: [{0}]", transactionId)); performIndexActions(progress, transactionId); progress.status(format("Finished indexing for transaction id: [{0}]", transactionId)); } else { progress.status(format("No index actions found for transaction id: [{0}]", transactionId)); } return null; } }
IndexJobService { @Timed( value = "service.index", description = "Timing information for the index service.", histogram = true) public Void executeJob(Progress progress, String transactionId) { requireNonNull(progress); IndexActionGroup indexActionGroup = dataService.findOneById(INDEX_ACTION_GROUP, transactionId, IndexActionGroup.class); if (indexActionGroup != null && indexActionGroup.getCount() > 0) { progress.setProgressMax(indexActionGroup.getCount()); progress.status(format("Start indexing for transaction id: [{0}]", transactionId)); performIndexActions(progress, transactionId); progress.status(format("Finished indexing for transaction id: [{0}]", transactionId)); } else { progress.status(format("No index actions found for transaction id: [{0}]", transactionId)); } return null; } IndexJobService(
      DataService dataService, IndexService indexService, EntityTypeFactory entityTypeFactory); }
IndexJobService { @Timed( value = "service.index", description = "Timing information for the index service.", histogram = true) public Void executeJob(Progress progress, String transactionId) { requireNonNull(progress); IndexActionGroup indexActionGroup = dataService.findOneById(INDEX_ACTION_GROUP, transactionId, IndexActionGroup.class); if (indexActionGroup != null && indexActionGroup.getCount() > 0) { progress.setProgressMax(indexActionGroup.getCount()); progress.status(format("Start indexing for transaction id: [{0}]", transactionId)); performIndexActions(progress, transactionId); progress.status(format("Finished indexing for transaction id: [{0}]", transactionId)); } else { progress.status(format("No index actions found for transaction id: [{0}]", transactionId)); } return null; } IndexJobService(
      DataService dataService, IndexService indexService, EntityTypeFactory entityTypeFactory); @Timed( value = "service.index", description = "Timing information for the index service.", histogram = true) Void executeJob(Progress progress, String transactionId); }
IndexJobService { @Timed( value = "service.index", description = "Timing information for the index service.", histogram = true) public Void executeJob(Progress progress, String transactionId) { requireNonNull(progress); IndexActionGroup indexActionGroup = dataService.findOneById(INDEX_ACTION_GROUP, transactionId, IndexActionGroup.class); if (indexActionGroup != null && indexActionGroup.getCount() > 0) { progress.setProgressMax(indexActionGroup.getCount()); progress.status(format("Start indexing for transaction id: [{0}]", transactionId)); performIndexActions(progress, transactionId); progress.status(format("Finished indexing for transaction id: [{0}]", transactionId)); } else { progress.status(format("No index actions found for transaction id: [{0}]", transactionId)); } return null; } IndexJobService(
      DataService dataService, IndexService indexService, EntityTypeFactory entityTypeFactory); @Timed( value = "service.index", description = "Timing information for the index service.", histogram = true) Void executeJob(Progress progress, String transactionId);  }