@Test public void testBuildEveryParamFromInvalidFormat() { final MethodInfo target = index.getClassByName(DotName.createSimple(BeanWithScheduledMethods.class.getName())) .method("invalidFormatFixedRate"); AnnotationInstance annotation = target.annotation(SpringScheduledProcessor.SPRING_SCHEDULED); try { springScheduledProcessor.buildEveryParam(annotation.values()); fail(); } catch (IllegalArgumentException expected) { } }
AnnotationValue buildEveryParam(List<AnnotationValue> springAnnotationValues) { long fixedRate = getLongValueFromParam(springAnnotationValues, "fixedRate"); String fixedRateString; fixedRateString = Duration.ofMillis(fixedRate).toString(); AnnotationValue every = AnnotationValue.createStringValue("every", fixedRateString); return every; }
SpringScheduledProcessor { AnnotationValue buildEveryParam(List<AnnotationValue> springAnnotationValues) { long fixedRate = getLongValueFromParam(springAnnotationValues, "fixedRate"); String fixedRateString; fixedRateString = Duration.ofMillis(fixedRate).toString(); AnnotationValue every = AnnotationValue.createStringValue("every", fixedRateString); return every; } }
SpringScheduledProcessor { AnnotationValue buildEveryParam(List<AnnotationValue> springAnnotationValues) { long fixedRate = getLongValueFromParam(springAnnotationValues, "fixedRate"); String fixedRateString; fixedRateString = Duration.ofMillis(fixedRate).toString(); AnnotationValue every = AnnotationValue.createStringValue("every", fixedRateString); return every; }  }
SpringScheduledProcessor { AnnotationValue buildEveryParam(List<AnnotationValue> springAnnotationValues) { long fixedRate = getLongValueFromParam(springAnnotationValues, "fixedRate"); String fixedRateString; fixedRateString = Duration.ofMillis(fixedRate).toString(); AnnotationValue every = AnnotationValue.createStringValue("every", fixedRateString); return every; }  @BuildStep List<UnremovableBeanBuildItem> unremovableBeans(); }
SpringScheduledProcessor { AnnotationValue buildEveryParam(List<AnnotationValue> springAnnotationValues) { long fixedRate = getLongValueFromParam(springAnnotationValues, "fixedRate"); String fixedRateString; fixedRateString = Duration.ofMillis(fixedRate).toString(); AnnotationValue every = AnnotationValue.createStringValue("every", fixedRateString); return every; }  @BuildStep List<UnremovableBeanBuildItem> unremovableBeans();  }