com.github.invictum.velocity.ChooseTool Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of unified-test-junit Show documentation
Show all versions of unified-test-junit Show documentation
Integration with jUnit test framework. Based on Serenity BDD project.
The newest version!
package com.github.invictum.velocity;
import org.apache.commons.lang3.RandomUtils;
import org.apache.velocity.tools.config.DefaultKey;
import org.apache.velocity.tools.generic.FormatConfig;
@DefaultKey("choose")
public class ChooseTool extends FormatConfig {
public T one(T[] list) {
int index = RandomUtils.nextInt(0, list.length);
return list[index];
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy