VehicleAssignmentServiceImpl implements VehicleAssignmentService { public void resetAssignments(){ activeBlocksCache.invalidateAll(); tripSummaryCache.invalidateAll(); assignmentDao.deleteAll(); assignmentConfigService.deleteConfigValue("lastUpdated"); }  void setTransitDataService(TransitDataService tds); void setAssignmentDao(AssignmentDao assignmentDao); void setAssignmentConfigService(AssignmentConfigService assignmentConfigService); @PostConstruct void setup(); @Override Date getLastUpdated(); @Override boolean assign(String blockId, String vehicleId, Date date); @Override boolean assign(String blockId, String vehicleId); @Override List<Assignment> getAssignments(); @Override List<Assignment> getAssignments(Date date); @Override Map<String, String> getAssignmentsAsMap(); @Override Map<String, String> getAssignmentsAsMap(Date date); @Override String getAssignmentByBlockId(String blockId, Date date); @Override String getAssignmentByBlockId(String blockId); @Override List<String> getActiveVehicles(String query); @Override List<String> getActiveVehicles(); @Override List<ActiveBlock> getActiveBlocks(ServiceDate serviceDate); @Override List<ActiveBlock> getActiveBlocks(ServiceDate serviceDate, List<AgencyAndId> filterRoutes); @Override List<TripSummary> getTripsForBlock(String blockId); Date getCurrentDate(); void resetAssignments();  }
@Test public void resetAssignmentsTest(){ VehicleAssignmentServiceImpl vas = new VehicleAssignmentServiceImpl(); vas.setAssignmentDao(_assignmentDao); vas.setAssignmentConfigService(_assignmentConfigService); vas.setTransitDataService(tds); vas.setup(); vas.assign(BLOCK_ID, VEHICLE_ID); assertEquals(1, vas.getAssignments().size()); assertNotNull(vas.getLastUpdated()); vas.resetAssignments(); assertEquals(0, vas.getAssignments().size()); assertNull(vas.getLastUpdated()); }