Skip to main content

Primitive & Simple Types

Support for Primitive Types

AutoParams effortlessly generates test arguments for primitive data types, such as booleans, integers, and floats.

@ParameterizedTest
@AutoSource
void testMethod(
boolean x1, byte x2, int x3, long x4, float x5, double x6, char x7) {
}

Handling Simple Objects

The framework also provides test arguments in the form of simple objects like Strings, UUIDs, and BigIntegers.

@ParameterizedTest
@AutoSource
void testMethod(String x1, UUID x2, BigInteger x3) {
}

Enum Type Support

Enum types are seamlessly integrated as well. AutoParams will randomly select values from the enum for test arguments.

public enum Day {
SUNDAY, MONDAY, TUESDAY, WEDNESDAY,
THURSDAY, FRIDAY, SATURDAY
}
@ParameterizedTest
@AutoSource
void testMethod(Day arg) {
}