I am new to this group and this is my first post.
Can some one please help me to generate 5 Unique numbers in min and max range and then sort them in ascending order using groovy. note: I am doing this in soapui.
import org.apache.commons.lang.RandomStringUtils
import java.util.Random
Random r = new Random();
def i
List random_num
for (i=1;i<=5;i++)
{
random_num(i) = r.nextInt(9+2)
if(i>0)
{
if(random_num[i]==random_num[i-1])
random_num[i] = r.nextInt(9+2)
}
}
random_num.sort() ;
log.info random_num
thank you