@ tibortru answer works. I had a requirement where the requirement was to run scheduled spring batch job a lot more often in the test environments. I achieved this like so in the application-test.yml
batch
scheduler:
cron: 0 ${random.int[1,10]} 7-23 * * *
And referenced it like so:
@Scheduled(cron = "${batch.scheduler.cron}")
public void runJob()