test-arranger
test-arranger copied to clipboard
Arranges test data as fully populated objects
Currently instantiation of EnumSet ends up with: ``` Caused by: java.lang.InstantiationError: java.util.EnumSet at java.base/jdk.internal.reflect.GeneratedSerializationConstructorAccessor6.newInstance(Unknown Source) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) at org.objenesis.instantiator.sun.SunReflectionFactoryInstantiator.newInstance(SunReflectionFactoryInstantiator.java:48) at org.objenesis.ObjenesisBase.newInstance(ObjenesisBase.java:73) at org.jeasy.random.util.ReflectionUtils.createEmptyCollectionForType(ReflectionUtils.java:498) at org.jeasy.random.CollectionPopulator.getRandomCollection(CollectionPopulator.java:58) at org.jeasy.random.FieldPopulator.generateRandomValue(FieldPopulator.java:139) at...
Similar to kotlin's data Class copy methods. Should create new instance with values taken from old instance and accept overrides. ``` Rearranger.copy(object, Map) ```
It could be whatever exists in the classpath, i.e. a solution on top of #28 . Some additional languages should have predefined Markov chains (pl, de...)
If a field is abstract, e.g. of type `java.lang.Number` and there are concrete types extending it, test-arranger could create an instance of one of the child types and us it...
It will be convenient to have similar set of methods as in the case of int
When in artifact can be handled as a dependency and does not have to contribute to the size of source code base.
Given: ``` public record SomeRecord(double someValue); ``` When: ``` some(SomeRecord.class, Map.of("someValue", () -> 1.0); ``` Then: the following exception is thrown ``` Unable to create a random instance of type...