Skip to content

Releases: qala-io/datagen

1.11.0 Add JUnit5 Pilot support

09 Jun 19:04
Compare
Choose a tag to compare

You can use Datagen + JUnit5 integration to facilitate randomization in parameterized tests. Examples:

    @Alphanumeric(length = 1, name = "min boundary")
    @Alphanumeric(min = 2, max = 29, name = "middle value")
    @Alphanumeric(length = 30, name = "max boundary")
    void validationPasses_forValidName(String dogName) {
        assertTrue(new Dog(dogName).isValid());
    }

This will run the test 4 times with different parameters according to the annotations. This test will run 2 times:

    @RandomInt(min = 1, name = "greater than zero")
    @RandomInt(max = -1, name = "less than zero")
    void zeroIsNotPassed(int param) {
        assertNotEquals(0, param);
    }

release-1.9.0

25 Sep 09:08
Compare
Choose a tag to compare
  • Generating random doubles like positiveDouble()
  • blankOr(String) to return one of: null, empty string, string with spaces, passed string.