RandomGenKt alternatives and similar libraries
Based on the "Tests" category.
Alternatively, view RandomGenKt alternatives based on common mentions on social networks and blogs.
-
Kotest
Powerful, elegant and flexible test framework for Kotlin with additional assertions, property testing and data driven testing -
kotlin-faker
https://serpro69.github.io/kotlin-faker/ Generate realistically looking fake data such as names, addresses, banking details, and many more, that can be used for testing and data anonymization purposes. -
hikaku
A library that tests if the implementation of a REST-API meets its specification. -
minutest
Simple, Expressive, Extensible Testing for Kotlin on the JVM -
balin
Balin is an automation library for Kotlin. It's basically a Selenium-WebDriver wrapper inspired by Geb. -
arbitrater
Arbitrater is a Kotlin library for creating arbitrary instances of classes by reflection for use in testing. In contrast to POJO generators, it supports Kotlin's optional parameters and nullable types. -
SeleniumBuilder
Kotlin DSL for Selenium. Provide a possibility to write tests in Kotlin type-safe builders style -
aspen
Aspen is a simple test runner for Kotlin that allows you to write tests using your own DSL. -
mock-fuel
JUnit 5 extension to easily test with the http client Fuel for Kotlin
Appwrite - The Open Source Firebase alternative introduces iOS support
Do you think we are missing an alternative of RandomGenKt or a related project?
README
RandomGenKt
Initialize instances of any class with generated data.
This is a Kotlin port of the Java library designed to generate random instances of any class.
This is great for demoing your app with interesting content, manually testing it with varying data, and even populating it with smart, random generated data in production.
Install
In your build.gradle
, add the following:
dependencies {
implementation("com.mitteloupe:randomgenkt:1.0.1")
}
To include the default data generators, also include
dependencies {
implementation("com.mitteloupe:randomgenkt.datasource:1.0.1")
}
Note: To add the BinTray repository in your maven repositories, also add the following:
repositories {
maven {
url "https://dl.bintray.com/shadowcra/RandomGenKt"
}
}
Usage
Kotlin
val randomGen = RandomGen.Builder<ObjectClass>()
.ofClass<ObjectClass>()
.withField("id")
.returningSequentialInteger()
.withField("uuid")
.returningUuid()
.build()
Java
RandomGen<ObjectClass> randomGen = new RandomGen.Builder<ObjectClass>()
.ofClass(ObjectClass.class)
.withField("id")
.returningSequentialInteger()
.withField("uuid")
.returningUuid()
.build();
This will create a RandomGen
instance producing ObjectClass
instances with sequential IDs and random UUIDs.
To use the newly generated RandomGen
, simply call:
Kotlin
val instance = randomGen.generate()
Java
ObjectClass instance = randomGen.generate();
What's New?
The Kotlin version adds the following:
- Support for fields with lazy init
- Lambdas
ofClass<Type>()
instead ofofClass(Type::class.java)
Created by
License
MIT © Eran Boudjnah
*Note that all licence references and agreements mentioned in the RandomGenKt README section above
are relevant to that project's source code only.