Skip to content

pelletier197/Fixkture

Repository files navigation

JetBrains IntelliJ plugins JetBrains IntelliJ Plugins CircleCI

Fixkture

Fixkture is an Intellij Plugin to generate test fixtures that supports both Java and Kotlin. It helps generate complex objects from a target class, which may be long and exhausting to do manually, especially for big objects. It does so by providing arbitrary parameters in the object's constructor.

Example

Given the sample data class

data class Example(
    val first: String,
    val second: List<String>
)

This is a really simple class, but the plugin will easily support generating an extremely complex object with nested objects in it.

Kotlin

The generated fixture will look like this

val example = Example(first = "first", second = listOf("second"))

The library will use standard library functions to achieve fixture generation in as little code as possible while keeping the fixture extremely readable.

Java

Here is the output code for the exact same class in Java

public static final Example example = new Example("first", List.of("second"));

Again, standard functions of Java 11 are used to generate the fixture components.

Usage

You can download the plugin from the Plugin Marketplace and follow the instructions detailed in the documentation of the plugin.

Contribute

You can contribute to this project by forking it and opening your own PR or by creating issues to propose improvements or report bugs.

About

An Intellij plugin to generate fixtures/fakes for your Kotlin and Java projects

Resources

Stars

Watchers

Forks

Languages