# TestParameterInjector introduces an idiomatic Kotlin API

DevFeed: [TestParameterInjector introduces an idiomatic Kotlin API](<https://devfeed.tech/articles/testparameterinjector-introduces-an-idiomatic-kotlin-api-34304.md>)

Original publisher: [Read original article](<http://opensource.googleblog.com/2026/05/testparameterinjector-introduces-an-idiomatic-kotlin-api.html>)

Author: Google Open Source (noreply@blogger.com)

Published: 2026-05-25T18:30:00Z

Content type: release

Language: en

Sources: [Google Open Source Blog](<https://devfeed.tech/sources/google-open-source-blog.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Testing](<https://devfeed.tech/topics/testing.md>), [unit tests](<https://devfeed.tech/topics/unit-tests.md>), [test-coverage](<https://devfeed.tech/topics/test-coverage.md>), [Java](<https://devfeed.tech/topics/java.md>), [Open Source](<https://devfeed.tech/topics/open-source.md>)

Tags: [java](<https://devfeed.tech/tags/java.md>), [junit4](<https://devfeed.tech/tags/junit4.md>), [junit5](<https://devfeed.tech/tags/junit5.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [open-source](<https://devfeed.tech/tags/open-source.md>), [parameterized-tests](<https://devfeed.tech/tags/parameterized-tests.md>), [test-coverage](<https://devfeed.tech/tags/test-coverage.md>), [testing](<https://devfeed.tech/tags/testing.md>), [testparameterinjector](<https://devfeed.tech/tags/testparameterinjector.md>), [unit-tests](<https://devfeed.tech/tags/unit-tests.md>)

## AI overview

Google announces KotlinTestParameters, a Kotlin-only API for TestParameterInjector. It uses Kotlin default function arguments to make parameterized tests type-safe, concise, and compatible with refactoring tools, avoiding string-based YAML maps and verbose provider classes.

## Source excerpt

by Jens Nyman, TestParameterInjector Team In March 2021, we announced the open source release of TestParameterInjector: a simple but powerful parameterized test runner for JUnit4. In September 2022, we followed up with JUnit5 support, bringing our framework to developers who had moved on to the Jupiter API. We're excited to announce our biggest update yet for our Kotlin users: KotlinTestParameters. The de facto standard for parameterized testing When we first introduced TestParameterInjector, we shared a graph showing its rapid adoption within Google. Over the past few years, that trajectory has continued to a point where TestParameterInjector is the de facto parameterized test framework. Usage of all other alternative frameworks continues to steadily decline, while TestParameterInjector's adoption keeps growing rapidly. It has fundamentally lowered the barrier to writing data-driven unit tests, empowering Googlers and open source developers alike to maximize test coverage with minimal boilerplate. We believe its ubiquity internally is a strong testament to its reliability and utility for the broader developer communities. The Kotlin challenge As Kotlin's popularity has surged, developers have naturally been writing more of their TestParameterInjector tests in Kotlin. However, specifying explicit test values in Kotlin historically meant falling back to Java-centric paradigms. If you wanted to provide specific values to a test, you typically had three options, none of which felt truly idiomatic in Kotlin: @TestParameter({"123", "456"}): This relies on string arrays, limiting you to a subset of types that the string parsing supports. @TestParameters: This allows for more complex sets of data, but relies on YAML strings (e.g.,"{age: 17, expectIsAdult: false}"). These strings however are not type-safe, and are completely ignored by IDE refactoring tools. Provider classes: For complex types that couldn't be easily represented in strings, you have to write Provider classe