@Test void generatedValueShouldBeWithinSpecifiedRange() { BigDecimal randomValue = randomizer.getRandomValue(); assertThat(randomValue.doubleValue()).isBetween(min, max); }
@Override public BigDecimal getRandomValue() { Double delegateRandomValue = delegate.getRandomValue(); BigDecimal randomValue = new BigDecimal(delegateRandomValue); if (scale != null) { randomValue = randomValue.setScale(this.scale, this.roundingMode); } return randomValue; }
BigDecimalRangeRandomizer implements Randomizer<BigDecimal> { @Override public BigDecimal getRandomValue() { Double delegateRandomValue = delegate.getRandomValue(); BigDecimal randomValue = new BigDecimal(delegateRandomValue); if (scale != null) { randomValue = randomValue.setScale(this.scale, this.roundingMode); } return randomValue; } }
BigDecimalRangeRandomizer implements Randomizer<BigDecimal> { @Override public BigDecimal getRandomValue() { Double delegateRandomValue = delegate.getRandomValue(); BigDecimal randomValue = new BigDecimal(delegateRandomValue); if (scale != null) { randomValue = randomValue.setScale(this.scale, this.roundingMode); } return randomValue; } BigDecimalRangeRandomizer(final Double min, final Double max);  BigDecimalRangeRandomizer(final Double min, final Double max, final long seed);  BigDecimalRangeRandomizer(final Double min, final Double max, final Integer scale);  BigDecimalRangeRandomizer(final Double min, final Double max, final Integer scale, final RoundingMode roundingMode);  BigDecimalRangeRandomizer(final Double min, final Double max, final long seed, final Integer scale);  BigDecimalRangeRandomizer(final Double min, final Double max, final long seed, final Integer scale, final RoundingMode roundingMode); }
BigDecimalRangeRandomizer implements Randomizer<BigDecimal> { @Override public BigDecimal getRandomValue() { Double delegateRandomValue = delegate.getRandomValue(); BigDecimal randomValue = new BigDecimal(delegateRandomValue); if (scale != null) { randomValue = randomValue.setScale(this.scale, this.roundingMode); } return randomValue; } BigDecimalRangeRandomizer(final Double min, final Double max);  BigDecimalRangeRandomizer(final Double min, final Double max, final long seed);  BigDecimalRangeRandomizer(final Double min, final Double max, final Integer scale);  BigDecimalRangeRandomizer(final Double min, final Double max, final Integer scale, final RoundingMode roundingMode);  BigDecimalRangeRandomizer(final Double min, final Double max, final long seed, final Integer scale);  BigDecimalRangeRandomizer(final Double min, final Double max, final long seed, final Integer scale, final RoundingMode roundingMode); static BigDecimalRangeRandomizer aNewBigDecimalRangeRandomizer(final Double min, final Double max); static BigDecimalRangeRandomizer aNewBigDecimalRangeRandomizer(final Double min, final Double max, final long seed); static BigDecimalRangeRandomizer aNewBigDecimalRangeRandomizer(final Double min, final Double max, final Integer scale); static BigDecimalRangeRandomizer aNewBigDecimalRangeRandomizer(final Double min, final Double max, final Integer scale, final RoundingMode roundingMode); static BigDecimalRangeRandomizer aNewBigDecimalRangeRandomizer(final Double min, final Double max, final long seed, final Integer scale); static BigDecimalRangeRandomizer aNewBigDecimalRangeRandomizer(final Double min, final Double max, final long seed, final Integer scale, final RoundingMode roundingMode); @Override BigDecimal getRandomValue(); }
BigDecimalRangeRandomizer implements Randomizer<BigDecimal> { @Override public BigDecimal getRandomValue() { Double delegateRandomValue = delegate.getRandomValue(); BigDecimal randomValue = new BigDecimal(delegateRandomValue); if (scale != null) { randomValue = randomValue.setScale(this.scale, this.roundingMode); } return randomValue; } BigDecimalRangeRandomizer(final Double min, final Double max);  BigDecimalRangeRandomizer(final Double min, final Double max, final long seed);  BigDecimalRangeRandomizer(final Double min, final Double max, final Integer scale);  BigDecimalRangeRandomizer(final Double min, final Double max, final Integer scale, final RoundingMode roundingMode);  BigDecimalRangeRandomizer(final Double min, final Double max, final long seed, final Integer scale);  BigDecimalRangeRandomizer(final Double min, final Double max, final long seed, final Integer scale, final RoundingMode roundingMode); static BigDecimalRangeRandomizer aNewBigDecimalRangeRandomizer(final Double min, final Double max); static BigDecimalRangeRandomizer aNewBigDecimalRangeRandomizer(final Double min, final Double max, final long seed); static BigDecimalRangeRandomizer aNewBigDecimalRangeRandomizer(final Double min, final Double max, final Integer scale); static BigDecimalRangeRandomizer aNewBigDecimalRangeRandomizer(final Double min, final Double max, final Integer scale, final RoundingMode roundingMode); static BigDecimalRangeRandomizer aNewBigDecimalRangeRandomizer(final Double min, final Double max, final long seed, final Integer scale); static BigDecimalRangeRandomizer aNewBigDecimalRangeRandomizer(final Double min, final Double max, final long seed, final Integer scale, final RoundingMode roundingMode); @Override BigDecimal getRandomValue();  }