@Test void testGetMasterDefectRate() { TimerValues timerValues = new TimerValues(); String timerRate = timerValues.getMasterDefectRate(null); final String defaultRate = String.valueOf(2 * TimerValues.HOUR); Assertions.assertEquals(defaultRate, timerRate); TimerConfigurationType timerConfiguration = new TimerConfigurationType(); timerRate = timerValues.getMasterDefectRate(timerConfiguration); Assertions.assertEquals(defaultRate, timerRate); TimerType timerType = new TimerType(); timerType.setUnit(Calendar.HOUR_OF_DAY); timerType.setLength(1); timerConfiguration.setMasterAndDefectListRenewal(timerType); timerRate = timerValues.getMasterDefectRate(timerConfiguration); Assertions.assertEquals(String.valueOf(60 * 60 * 1000), timerRate); }
@Bean public String getMasterDefectRate(TimerConfigurationType timerConfiguration) { String timerName = "Master and defect list renewal"; if (timerConfiguration != null && timerConfiguration.getMasterAndDefectListRenewal() != null) { TimerType renewal = timerConfiguration.getMasterAndDefectListRenewal(); if (renewal.getLength() != 0 && renewal.getUnit() != 0) { String rate = String.valueOf(getUnitOfTime(renewal.getUnit()) * renewal.getLength()); logRateForTimer(timerName, rate); return rate; } } String rate = String.valueOf(2 * HOUR); logRateForTimer(timerName, rate); return rate; }
TimerValues { @Bean public String getMasterDefectRate(TimerConfigurationType timerConfiguration) { String timerName = "Master and defect list renewal"; if (timerConfiguration != null && timerConfiguration.getMasterAndDefectListRenewal() != null) { TimerType renewal = timerConfiguration.getMasterAndDefectListRenewal(); if (renewal.getLength() != 0 && renewal.getUnit() != 0) { String rate = String.valueOf(getUnitOfTime(renewal.getUnit()) * renewal.getLength()); logRateForTimer(timerName, rate); return rate; } } String rate = String.valueOf(2 * HOUR); logRateForTimer(timerName, rate); return rate; } }
TimerValues { @Bean public String getMasterDefectRate(TimerConfigurationType timerConfiguration) { String timerName = "Master and defect list renewal"; if (timerConfiguration != null && timerConfiguration.getMasterAndDefectListRenewal() != null) { TimerType renewal = timerConfiguration.getMasterAndDefectListRenewal(); if (renewal.getLength() != 0 && renewal.getUnit() != 0) { String rate = String.valueOf(getUnitOfTime(renewal.getUnit()) * renewal.getLength()); logRateForTimer(timerName, rate); return rate; } } String rate = String.valueOf(2 * HOUR); logRateForTimer(timerName, rate); return rate; }  }
TimerValues { @Bean public String getMasterDefectRate(TimerConfigurationType timerConfiguration) { String timerName = "Master and defect list renewal"; if (timerConfiguration != null && timerConfiguration.getMasterAndDefectListRenewal() != null) { TimerType renewal = timerConfiguration.getMasterAndDefectListRenewal(); if (renewal.getLength() != 0 && renewal.getUnit() != 0) { String rate = String.valueOf(getUnitOfTime(renewal.getUnit()) * renewal.getLength()); logRateForTimer(timerName, rate); return rate; } } String rate = String.valueOf(2 * HOUR); logRateForTimer(timerName, rate); return rate; }  @Bean String getFullBlacklistRate(); @Bean String getDeltaBlacklistRate(TimerConfigurationType timerConfiguration); @Bean String getCVCRate(TimerConfigurationType timerConfiguration); @Bean String getMasterDefectRate(TimerConfigurationType timerConfiguration); @Bean String getCrlRate(TimerConfigurationType timerConfiguration); @Bean String getKeyLockRate(); }
TimerValues { @Bean public String getMasterDefectRate(TimerConfigurationType timerConfiguration) { String timerName = "Master and defect list renewal"; if (timerConfiguration != null && timerConfiguration.getMasterAndDefectListRenewal() != null) { TimerType renewal = timerConfiguration.getMasterAndDefectListRenewal(); if (renewal.getLength() != 0 && renewal.getUnit() != 0) { String rate = String.valueOf(getUnitOfTime(renewal.getUnit()) * renewal.getLength()); logRateForTimer(timerName, rate); return rate; } } String rate = String.valueOf(2 * HOUR); logRateForTimer(timerName, rate); return rate; }  @Bean String getFullBlacklistRate(); @Bean String getDeltaBlacklistRate(TimerConfigurationType timerConfiguration); @Bean String getCVCRate(TimerConfigurationType timerConfiguration); @Bean String getMasterDefectRate(TimerConfigurationType timerConfiguration); @Bean String getCrlRate(TimerConfigurationType timerConfiguration); @Bean String getKeyLockRate();  }