Class RandomRangeResolver

java.lang.Object
rife.bld.extension.testing.RandomRangeResolver
All Implemented Interfaces:
Extension, ParameterResolver, TestInstancePostProcessor, TestInstantiationAwareExtension

public class RandomRangeResolver extends Object implements ParameterResolver, TestInstancePostProcessor
Parameter and field resolver for the RandomRange annotation.

This resolver automatically injects random integer values into test method parameters that are annotated with @RandomRange or are part of test methods annotated with @RandomRange at the method level.

Supported Types:

  • int - single random integer (when size = 0)
  • List<Integer> - list of random integers (when size > 0)
  • Set<Integer> - set of unique random integers (when size > 0)

Resolution Priority:

When both parameter-level and method-level @RandomRange annotations are present, the parameter-level annotation takes precedence.

If only a method-level annotation exists, its configuration applies to all int parameters in that method.

The resolver validates that:

  • The parameter is annotated with @RandomRange or the method is annotated with @RandomRange
  • The parameter type is int, List<Integer>, or Set<Integer>
  • The minimum value is not greater than the maximum value
Since:
1.0
Author:
Erik C. Thauvin
See Also: