### Question:
SpringScheduledProcessor { List<AnnotationValue> buildDelayParams(List<AnnotationValue> springAnnotationValues) { List<AnnotationValue> confValues = new ArrayList<>(); long delay = getLongValueFromParam(springAnnotationValues, "initialDelay"); confValues.add(AnnotationValue.createLongValue("delay", delay)); confValues.add(AnnotationValue.createEnumValue("delayUnit", DotName.createSimple("java.util.concurrent.TimeUnit"), TimeUnit.MILLISECONDS.name())); return confValues; }  @BuildStep List<UnremovableBeanBuildItem> unremovableBeans();  }### Answer:
@Test public void testBuildDelayParam() { final MethodInfo target = index.getClassByName(DotName.createSimple(BeanWithScheduledMethods.class.getName())) .method("checkEverySecondWithDelay"); AnnotationInstance annotation = target.annotation(SpringScheduledProcessor.SPRING_SCHEDULED); List<AnnotationValue> annotationValues = springScheduledProcessor.buildDelayParams(annotation.values()); AnnotationValue expectedDelayValue = AnnotationValue.createLongValue("delay", 1000L); AnnotationValue expectedDelayUnitValue = AnnotationValue.createEnumValue("delayUnit", DotName.createSimple("java.util.concurrent.TimeUnit"), TimeUnit.MILLISECONDS.name()); assertThat(annotationValues).contains(expectedDelayValue); assertThat(annotationValues).contains(expectedDelayUnitValue); }
@Test public void testBuildDelayParamFromString() { final MethodInfo target = index.getClassByName(DotName.createSimple(BeanWithScheduledMethods.class.getName())) .method("checkEverySecondWithDelayString"); AnnotationInstance annotation = target.annotation(SpringScheduledProcessor.SPRING_SCHEDULED); List<AnnotationValue> annotationValues = springScheduledProcessor.buildDelayParams(annotation.values()); AnnotationValue expectedDelayValue = AnnotationValue.createLongValue("delay", 1000L); AnnotationValue expectedDelayUnitValue = AnnotationValue.createEnumValue("delayUnit", DotName.createSimple("java.util.concurrent.TimeUnit"), TimeUnit.MILLISECONDS.name()); assertThat(annotationValues).contains(expectedDelayValue); assertThat(annotationValues).contains(expectedDelayUnitValue); }
@Test public void testBuildDelayParamFromInvalidFormat() { final MethodInfo target = index.getClassByName(DotName.createSimple(BeanWithScheduledMethods.class.getName())) .method("invalidFormatInitialDelay"); AnnotationInstance annotation = target.annotation(SpringScheduledProcessor.SPRING_SCHEDULED); try { springScheduledProcessor.buildDelayParams(annotation.values()); fail(); } catch (IllegalArgumentException expected) { } }