Package rs.baselib.test
package rs.baselib.test
Provides classes for test-related issues.
The package provides various builders that can be used to generate (random) test data.
Use it e.g. like this:
import static rs.baselib.test.BuilderUtils.*; PersonBuilder b1 = $Person().withMinAge(21).withMaxAge(35); Person person = b1.build; String firstName = person.firstName; String lastName = person.lastName; String gender = person.gender; LocalDate birthday = person.birthday; int age = person.age; IntBuilder b2 = $Int().withRandom(); int random = b2.build();
You can combine builders to produce lists or arrays:
List<Integer> intList = listOf(3, $Int().withRandom()); Person[] personArray = arrayOf(5, $Person());
-
ClassDescriptionArrayBuilder<T>Creates random number of values from a builder.Builder<T>Interface for test factory Builder patternHelps using the builder pattern.EnumerationBuilder<T extends Enum<T>>Selects values from an enumeration (randomly).Provides check methods for the
IgnoreTest
annotation.Annotates a Java object to be ignored in tests.An Integer builder.ListBuilder<T>Selects values from an enumeration (randomly)A Long builder.Provides a way to generate personal information (seePersonBuilder.Person
randomly.Information about a random, fictious person.A random string builder.A string builder.