Skip to content

Releases: linux-china/easy-random-junit5-extension

0.5.0

28 Jan 07:46
Compare
Choose a tag to compare
  • Jakarta Validation 3 support
  • Data Faker support

0.3.0

19 Oct 20:34
Compare
Choose a tag to compare
  • JDK 17 only: for Java 8 & 11, please use version 0.2.0
  • Java Records support
    record Person(@Positive int id, @Email String email) {
    }

    @Test
    public void testRecord(@Random Person person) {
        System.out.println("person.id = " + person.id());
        System.out.println("person.email = " + person.email());
    }

0.2.0

12 Sep 23:18
Compare
Choose a tag to compare

i18n friendly to Faker's types

import com.github.javafaker.Address  
  
@Test
public void testAddress(@Random(locale = "zh_CN") Address address) {
  System.out.println(address.cityName());
}

0.1.2

12 Sep 21:04
Compare
Choose a tag to compare

Custom Annotation with Validation annotation, such as @phone

@Documented
@Constraint(validatedBy = {})
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
@Retention(RUNTIME)
@Pattern(regexp = "(136|137|186)\\d{8}")
public @interface Phone {
}

0.1.1

05 Sep 04:44
Compare
Choose a tag to compare

Introduce ByteBuddy to mock Field

Initial version

05 Sep 00:21
Compare
Choose a tag to compare

The easy random extension provides a test with randomly generated objects, including:

  • JDK types: int/double/BigDecimal/boolean/String etc
  • Custom types: POJO, except for records support
  • Generic collections: List/Set/Stream/Array
  • Java Validation annotations: @Email, @pattern etc