RandomValuePropertySource

PropertySource that returns a random value for any property that starts with "random.". Where the "unqualified property name" is the portion of the requested property name beyond the "random." prefix, this PropertySource returns:

  • When "int", a random Integer value, restricted by an optionally specified range.
  • When "long", a random Long value, restricted by an optionally specified range.
  • When "uuid", a random UUID value.
  • Otherwise, a byte[].
The "random.int" and "random.long" properties supports a range suffix whose syntax is:

OPEN value (,max) CLOSE where the OPEN,CLOSE are any character and value,max are integers. If max is not provided, then 0 is used as the lower bound and value is the upper bound. If max is provided then value is the minimum value and max is the maximum (exclusive).

Author

Dave Syer

Matt Benson

Madhura Bhave

Moritz Halbritter

Since

1.0.0

Constructors

Link copied to clipboard
constructor()
constructor(name: String)

Properties

Link copied to clipboard
Name of the random PropertySource.

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun equals(other: Any): Boolean
Link copied to clipboard
open fun getName(): String
Link copied to clipboard
open fun getProperty(name: String): Any
Link copied to clipboard
open fun getSource(): T
Link copied to clipboard
open fun hashCode(): Int
Link copied to clipboard
open fun named(name: String): PropertySource<out Any>
Link copied to clipboard
open fun toString(): String