Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Java
  3. AutoParams

AutoParams

MITJava11.4.0-beta.1

A JUnit 5 extension for automatic test data generation in Java and Kotlin, eliminating manual setup for parameterized tests.

Visit WebsiteGitHubGitHub
368 stars59 forks0 contributors

What is AutoParams?

AutoParams is a JUnit 5 extension that automatically generates test data for parameterized tests in Java and Kotlin. It eliminates the manual creation of test values, reducing boilerplate and allowing developers to focus on test logic. The tool supports advanced features like value freezing, customization, and integrations with popular frameworks like Spring and Mockito.

Target Audience

Java and Kotlin developers writing unit and integration tests, particularly those using JUnit 5 for parameterized testing or working in Spring-based applications.

Value Proposition

AutoParams saves time by automating test data generation, reduces repetitive code, and enhances test coverage with randomized inputs. Its extensible design and framework integrations make it a versatile choice for modern Java/Kotlin testing workflows.

Overview

AutoParams is a versatile test data generator designed for parameterized tests in Java and Kotlin.

Use Cases

Best For

  • Automating test data generation for JUnit 5 parameterized tests
  • Reducing boilerplate in unit tests with complex object hierarchies
  • Integrating generated test data with Spring beans in integration tests
  • Creating consistent test doubles with Mockito for dependency injection
  • Testing Kotlin data classes with non-default randomized values
  • Applying business rules to generated data via custom object generators

Not Ideal For

  • Tests requiring fully deterministic, reproducible inputs for debugging or compliance audits
  • Teams using testing frameworks other than JUnit 5, such as TestNG or Spock
  • Projects with trivial test data needs where manual setup is faster than learning AutoParams' annotations
  • Performance-sensitive test suites where dynamic generation overhead is unacceptable

Pros & Cons

Pros

Automatic Test Data Generation

Eliminates boilerplate by auto-populating JUnit 5 test parameters with randomized data using @AutoParams annotation, making tests concise and focused, as shown in the Calculator example.

Flexible Customization Options

Supports custom object generators, DSL for one-time customizations, and annotations like @Min/@Max for precise control, enabling enforcement of business rules like in ProductGenerator.

Framework Integration Support

Offers extensions for Spring, Mockito, Lombok, and Kotlin, allowing seamless use in diverse ecosystems, such as injecting Spring beans with @UseBeans.

Value Consistency Mechanisms

Provides @Freeze and @FreezeBy annotations with matching strategies to ensure shared references in generated objects, simplifying tests with dependencies like Product and Review.

Cons

Configuration Complexity for Features

Advanced features like DSL customizations require enabling parameter names at compile time (-parameters flag) or using @ConstructorProperties, adding setup overhead and potential friction.

Annotation Overload and Learning Curve

The plethora of annotations (@AutoParams, @Freeze, @Customization, etc.) can be overwhelming, requiring significant time to master and increasing cognitive load for developers.

Tight JUnit 5 Coupling

AutoParams is exclusively designed for JUnit 5, making it incompatible with other testing frameworks and limiting adoption in mixed or legacy environments.

Open Source Alternative To

AutoParams is an open-source alternative to the following products:

A
AutoFixture

AutoFixture is an open-source library for .NET that automates the creation of test data, making it easier to write unit tests. It generates anonymous test data to reduce setup code in tests.

Frequently Asked Questions

Quick Stats

Stars368
Forks59
Contributors0
Open Issues21
Last commit6 months ago
CreatedSince 2021

Tags

#spring#junit5#unit-testing#tdd#java#unit#automated-testing#parameterized-tests#spring-integration#test-data-generation#java-testing#kotlin

Built With

J
JUnit 5
L
Lombok
S
Spring
K
Kotlin
M
Mockito
J
Java

Links & Resources

Website

Included in

Java47.5k
Auto-fetched 21 hours ago

Related Projects

Java FakerJava Faker

Brings the popular ruby faker gem to Java

Stars4,900
Forks863
Last commit2 years ago
DatafakerDatafaker

Generating fake data for the JVM (Java, Kotlin, Groovy) has never been easier!

Stars1,800
Forks242
Last commit1 day ago
InstancioInstancio

A library that creates fully populated objects for your unit tests.

Stars1,164
Forks69
Last commit1 day ago
jFairyjFairy

Java fake data generator

Stars744
Forks150
Last commit3 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub