HarvestBandwidthManagerImpl implements HarvestBandwidthManager { @Override public boolean isMiniumBandwidthAvailable(QueuedTargetInstanceDTO aTargetInstance) { if (null == aTargetInstance) { throw new WCTRuntimeException("The Target Instance passed in was null."); } if (getCurrentGlobalMaxBandwidth() < getMinimumBandwidth()) { return false; } TargetInstance ti = targetInstanceDao.load(aTargetInstance.getOid()); ti = targetInstanceDao.populate(ti); return isMiniumBandwidthAvailable(ti); }  @Override void sendBandWidthRestrictions(); @Override HashMap<Long, TargetInstance> calculateBandwidthAllocation(TargetInstance aTargetInstance); @Override HashMap<Long, TargetInstance> calculateBandwidthAllocation(); @Override long getCurrentGlobalMaxBandwidth(); @Override boolean isMiniumBandwidthAvailable(QueuedTargetInstanceDTO aTargetInstance); @Override boolean isMiniumBandwidthAvailable(TargetInstance aTargetInstance); @Override synchronized void checkForBandwidthTransition(); @Override boolean isHarvestOptimizationAllowed(); @Override BandwidthRestriction getBandwidthRestriction(Long oid); @Override void saveOrUpdate(BandwidthRestriction bandwidthRestriction); @Override void delete(BandwidthRestriction bandwidthRestriction); @Override BandwidthRestriction getBandwidthRestriction(String aDay, Date aTime); @Override HashMap<String, List<BandwidthRestriction>> getBandwidthRestrictions(); @Override int getMinimumBandwidth(); @Override void setMinimumBandwidth(int minimumBandwidth); @Override int getMaxBandwidthPercent(); @Override void setMaxBandwidthPercent(int maxBandwidthPercent); void setHarvestCoordinatorDao(HarvestCoordinatorDAO harvestCoordinatorDao); void setHarvestAgentManager(HarvestAgentManager harvestAgentManager); void setTargetInstanceDao(TargetInstanceDAO targetInstanceDao); void setAuditor(Auditor auditor); void setBandwidthCalculator(BandwidthCalculator bandwidthCalculator);  }
@Test(expected=WCTRuntimeException.class) public void testMinimumBandwidthNullQueued() { underTest.isMiniumBandwidthAvailable((QueuedTargetInstanceDTO)null); }
@Test(expected=WCTRuntimeException.class) public void testMinimumBandwidthNullTi() { underTest.isMiniumBandwidthAvailable((TargetInstance)null); }