@Test public void testErrorInAssignUserToExports() { doThrow(new RuntimeException("exception")).when(ar).assignUserToExports(Mockito.eq(assignment), Mockito.any()); AssignmentCountEnvelope env = new AssignmentCountEnvelope(ar, cass, mysql, exp, assignment, true, el, date, true, true); env.run(); }
@Override public void run() { try { if (assignBucketCount) { assignmentsRepository.updateBucketAssignmentCount(experiment, assignment, countUp); } } catch (Exception e) { LOGGER.error("Error updating the assignment counts for experiment: ", experiment.getID() + " bucket label: " + assignment.getBucketLabel() + " with exception: ", e); } try { if (countUp && assignUserToExport) { assignmentsRepository.assignUserToExports(assignment, date); } } catch (Exception e) { LOGGER.error("Error updating the assignment to the user export for experiment: ", experiment.getID() + " bucket label: " + assignment.getBucketLabel() + " with exception: ", e); } }
AssignmentCountEnvelope implements Runnable { @Override public void run() { try { if (assignBucketCount) { assignmentsRepository.updateBucketAssignmentCount(experiment, assignment, countUp); } } catch (Exception e) { LOGGER.error("Error updating the assignment counts for experiment: ", experiment.getID() + " bucket label: " + assignment.getBucketLabel() + " with exception: ", e); } try { if (countUp && assignUserToExport) { assignmentsRepository.assignUserToExports(assignment, date); } } catch (Exception e) { LOGGER.error("Error updating the assignment to the user export for experiment: ", experiment.getID() + " bucket label: " + assignment.getBucketLabel() + " with exception: ", e); } } }
AssignmentCountEnvelope implements Runnable { @Override public void run() { try { if (assignBucketCount) { assignmentsRepository.updateBucketAssignmentCount(experiment, assignment, countUp); } } catch (Exception e) { LOGGER.error("Error updating the assignment counts for experiment: ", experiment.getID() + " bucket label: " + assignment.getBucketLabel() + " with exception: ", e); } try { if (countUp && assignUserToExport) { assignmentsRepository.assignUserToExports(assignment, date); } } catch (Exception e) { LOGGER.error("Error updating the assignment to the user export for experiment: ", experiment.getID() + " bucket label: " + assignment.getBucketLabel() + " with exception: ", e); } } @Inject  AssignmentCountEnvelope(AssignmentsRepository assignmentsRepository,
                                   ExperimentRepository cassandraExperimentRepository,
                                   ExperimentRepository dbExperimentRepository,
                                   Experiment experiment, Assignment assignment, boolean countUp, EventLog eventLog,
                                   Date date, final @Named("assign.user.to.export") Boolean assignUserToExport,
                                   final @Named("assign.bucket.count") Boolean assignBucketCount); }
AssignmentCountEnvelope implements Runnable { @Override public void run() { try { if (assignBucketCount) { assignmentsRepository.updateBucketAssignmentCount(experiment, assignment, countUp); } } catch (Exception e) { LOGGER.error("Error updating the assignment counts for experiment: ", experiment.getID() + " bucket label: " + assignment.getBucketLabel() + " with exception: ", e); } try { if (countUp && assignUserToExport) { assignmentsRepository.assignUserToExports(assignment, date); } } catch (Exception e) { LOGGER.error("Error updating the assignment to the user export for experiment: ", experiment.getID() + " bucket label: " + assignment.getBucketLabel() + " with exception: ", e); } } @Inject  AssignmentCountEnvelope(AssignmentsRepository assignmentsRepository,
                                   ExperimentRepository cassandraExperimentRepository,
                                   ExperimentRepository dbExperimentRepository,
                                   Experiment experiment, Assignment assignment, boolean countUp, EventLog eventLog,
                                   Date date, final @Named("assign.user.to.export") Boolean assignUserToExport,
                                   final @Named("assign.bucket.count") Boolean assignBucketCount); @Override void run(); }
AssignmentCountEnvelope implements Runnable { @Override public void run() { try { if (assignBucketCount) { assignmentsRepository.updateBucketAssignmentCount(experiment, assignment, countUp); } } catch (Exception e) { LOGGER.error("Error updating the assignment counts for experiment: ", experiment.getID() + " bucket label: " + assignment.getBucketLabel() + " with exception: ", e); } try { if (countUp && assignUserToExport) { assignmentsRepository.assignUserToExports(assignment, date); } } catch (Exception e) { LOGGER.error("Error updating the assignment to the user export for experiment: ", experiment.getID() + " bucket label: " + assignment.getBucketLabel() + " with exception: ", e); } } @Inject  AssignmentCountEnvelope(AssignmentsRepository assignmentsRepository,
                                   ExperimentRepository cassandraExperimentRepository,
                                   ExperimentRepository dbExperimentRepository,
                                   Experiment experiment, Assignment assignment, boolean countUp, EventLog eventLog,
                                   Date date, final @Named("assign.user.to.export") Boolean assignUserToExport,
                                   final @Named("assign.bucket.count") Boolean assignBucketCount); @Override void run();  }