Generate realistically looking fake data such as names, addresses, banking details, and many more, that can be used for testing and data anonymization purposes.

Overview

kotlin-faker

Generates realistically-looking fake data
Just like this fake-logo, but not quite so.
fake-logo

Build Status Maven Central Sonatype Nexus (Snapshots) Issues GitHub Top Lang Awesome Kotlin Licence

ToC

About

Port of a popular ruby faker gem written in kotlin. Generates realistically looking fake data such as names, addresses, banking details, and many more, that can be used for testing purposes during development and testing.

Comparison with similar jvm-based "faker libs"

While there are several other libraries out there with similar functionalities, I had several reasons for creating this one:

  • most of the ones I've found are written in java and I wanted to use kotlin
  • none of them had the functionality I needed
  • I didn't feel like forking an existing kotlin-based lib - fakeit - and refactoring the entire codebase, especially with it not being maintained for the past couple of years.

So why use this one instead? I've decided to make a comparison between kotlin-faker, and others libs that have been out there for quite some time.

The benchmarks time is an average execution time of 10 consecutive runs. Each run includes creating a new Faker instance and generating a 1_000_000 values with the function returning a person's full name.

Note: benchmarks for blocoio/faker could not be done due to unexpected exceptions coming from the lib, benchmarks for moove-it/fakeit could not be done due to android dependencies in the lib

kotlin-faker DiUS/java-faker Devskiller/jfairy blocoio/faker moove-it/fakeit
language kotlin java java java kotlin
number of available providers (address, name, etc.) 171 73 8 21 36
number of available locales 55 47 10 46 44
extra functionality (i.e. randomClassInstance gen)
actively maintained
cli-bot app
benchmarks 5482ms 17529.9ms 15036.5ms NA NA

Usage

To learn more about kotlin-faker visit serpro69.github.io/kotlin-faker/. The content there is ~86% complete and should contain most of the relevant documentation to get you started with kotlin-faker. Else proceed reading this readme, which will also be around until the github-pages site is completed.

Downloading

Latest releases are always available on maven central.

With gradle

dependencies {
    implementation 'io.github.serpro69:kotlin-faker:$version'
}

With maven

<dependencies>
    <dependency>
        <groupId>io.github.serpro69groupId>
        <artifactId>kotlin-fakerartifactId>
        <version>${version}version>
    dependency>
dependencies>

Snapshots are also available using the following repository: https://oss.sonatype.org/content/repositories/snapshots/

With gradle

repositories {
    maven {
        url = 'https://oss.sonatype.org/content/repositories/snapshots/'
    }
}

With maven

<repositories>
    <repository>
        <id>sonatype-snapshotid>
        <name>Sonatype Snapshotname>
        <url>https://oss.sonatype.org/content/repositories/snapshots/url>
    repository>
repositories>

Downloading a jar
The jar and pom files can also be found at this link

Generating data

val faker = faker { }

faker.name.firstName() // => Ana
faker.address.city() // => New York

Configuring Faker

Default configuration

If no fakerConfig instance is passed to Faker constructor, or to the faker builder DSL, then default configuration will be used:

  • locale is set to en
  • random is seeded with a pseudo-randomly generated number.
  • uniqueGeneratorRetryLimit is set to 100

Using Kotlin DSL

Faker can use Kotlin DSL to create and configure Faker instances

val faker = faker { 
    config { 
        random = Random()
        locale = "nl"
        uniqueGeneratorRetryLimit = 111
    }
}

Deterministic Random

Faker supports seeding of it's PRNG (pseudo-random number generator) through configuration to provide deterministic output of repeated function invocations.

val faker = faker { config { random = Random(42) } }
val city1 = faker.address.city()
val name1 = faker.name.name()

val otherFaker = faker { config { random = Random(42) } }
val city1 = otherFaker.address.city()
val name1 = otherFaker.name.name()

city1 == city2 // => true
name1 == name2 // => true

Alternatively a seed can be specified instead of passing an instance of java.util.Random:

val fakerConfig = fakerConfig {
    randomSeed = 42
}

Generating unique values

Faker supports generation of unique values. There are basically two ways to generate unique values:

Unique values for entire provider

val faker = Faker()
faker.unique.configure {
    enable(faker::address) // enable generation of unique values for address provider
}

// will generate unique country each time it's called
repeat(10) { faker.address.country() }

To clear the record of unique values that were already generated:

faker.unique.clear(faker::address) // clears used values for address provider

faker.unique.clearAll() // clears used values for all providers

To disable generation of unique values:

faker.unique.disable(faker::address) // disables generation of unique values for address provider and clears all used values

faker.unique.disableAll() // disables generation of unique values for all providers and clears all used values

Unique values for particular functions of a provider

val faker = Faker()

repeat(10) { faker.address.unique.country() } // will generate unique country each time `country()` is prefixed with `unique`

repeat(10) { faker.address.city() } // this will not necessarily be unique (unless `faker.unique.enable(faker::address)` was called previously)

To clear the record of unique values that were already generated:

faker.address.unique.clear("city") // clears used values for `faker.address.unique.city()` function

faker.address.unique.clearAll() // clears used values for all functions of address provider

Configuring retry limit
If the retry count of unique generator exceeds the configured value (defaults to 100) then RetryLimitException will be thrown.

It is possible to re-configure the default value through FakerConfig:

val config = fakerConfig {
    uniqueGeneratorRetryLimit = 1000
}

val faker = Faker(config)

Excluding values from generation It is possible to exclude values from being generated with unique generator. This is configured on the faker level for each (or in some cases - all) of the providers.

(listOfNames) // Exclude listOfLastNames from being generated by Name#lastName function excludeFromFunction(Name::lastName, listOfLastNames) // Exclude values starting with "B" from being generated by any Name provider function excludeFromProvider { listOf(Regex("^B")) } // Exclude values starting with "C" from being generated by Name#country function excludeFromFunction(Name::lastName) { listOf(Regex("^C")) } } } // Based on the above config the following will be true in addition to generating unique values: val city = faker.address.city() assertTrue(listOfValues.contains(city) == false) assertTrue(city.startsWith("A") == false) val firstName = faker.name.firstName() val lastName = faker.name.lastName() assertTrue(listOfValues.contains(firstName) == false) assertTrue(listOfValues.contains(lastName) == false) assertTrue(listOfNames.contains(firstName) == false) assertTrue(listOfNames.contains(lastName) == false) assertTrue(listOfLastNames.contains(lastName) == false) assertTrue(firstName.startsWith("A") == false) assertTrue(lastName.startsWith("A") == false) assertTrue(firstName.startsWith("B") == false) assertTrue(lastName.startsWith("B") == false) assertTrue(lastName.startsWith("C") == false)">
val faker = Faker()

faker.unique.configuration {
    // Enable generation of unique values for Address provider
    // Any unique generation configuration will only affect "enabled" providers
    enable(faker::address)

    // Exclude listOfValues from being generated 
    // in all providers that are enabled for unique generation
    exclude(listOfValues)

    // Exclude values starting with "A" from being generated 
    // in all providers that are enabled for unique generation
    exclude { listOf(Regex("^A")) }

    // Additional configuration for particular provider
    // First enable generation of unique values for Name provider
    enable(faker::name) {
        // Exclude listOfNames from being generated by any Name provider function
        excludeFromProvider<Name>(listOfNames)

        // Exclude listOfLastNames from being generated by Name#lastName function
        excludeFromFunction(Name::lastName, listOfLastNames)

        // Exclude values starting with "B" from being generated by any Name provider function
        excludeFromProvider<Name> { listOf(Regex("^B")) }

        // Exclude values starting with "C" from being generated by Name#country function
        excludeFromFunction(Name::lastName) { listOf(Regex("^C")) }
    }
}

// Based on the above config the following will be true in addition to generating unique values:
val city = faker.address.city()
assertTrue(listOfValues.contains(city) == false)
assertTrue(city.startsWith("A") == false)

val firstName = faker.name.firstName()
val lastName = faker.name.lastName()
assertTrue(listOfValues.contains(firstName) == false)
assertTrue(listOfValues.contains(lastName) == false)
assertTrue(listOfNames.contains(firstName) == false)
assertTrue(listOfNames.contains(lastName) == false)
assertTrue(listOfLastNames.contains(lastName) == false)
assertTrue(firstName.startsWith("A") == false)
assertTrue(lastName.startsWith("A") == false)
assertTrue(firstName.startsWith("B") == false)
assertTrue(lastName.startsWith("B") == false)
assertTrue(lastName.startsWith("C") == false)

This is only applicable when the whole category, i.e. Address or Name is enabled for unique generation of values.

faker.address.unique.country() // will still generate unique values, but won't consider exclusions, if any

Localized dictionary

Faker can be configured to use a localized dictionary file instead of the default en locale.

Oslo">
val fakerConfig = fakerConfig {
    locale = "nb-NO"
}

val faker = Faker(fakerConfig)
val city1 = faker.address.city() // => Oslo
Available Locales
List of available locales (clickable):

  • ar
  • bg
  • ca
  • ca-CAT
  • da-DK
  • de
  • de-AT
  • de-CH
  • ee
  • en - default
  • en-AU
  • en-au-ocker
  • en-BORK
  • en-CA
  • en-GB
  • en-IND
  • en-MS
  • en-NEP
  • en-NG
  • en-NZ
  • en-PAK
  • en-SG
  • en-TH
  • en-UG
  • en-US
  • en-ZA
  • es
  • es-MX
  • fa
  • fi-FI
  • fr
  • fr-CA
  • fr-CH
  • he
  • hy
  • id
  • it
  • ja
  • ko
  • lv
  • nb-NO
  • nl
  • no
  • pl
  • pt
  • pt-BR
  • ru
  • sk
  • sv
  • th
  • tr
  • uk
  • vi
  • zh-CN
  • zh-TW

Using a non-default locale will replace the values in some of the providers with the values from localized dictionary.

Barcelona">
val faker = faker { config { locale = "es" } }
faker.address.city() // => Barcelona

Note that if the localized dictionary file does not contain a category (or a parameter in a category) that is present in the default locale, then non-localized value will be used instead.

Braavos">
val faker = Faker()
faker.gameOfThrones.cities() // => Braavos

val localizedFaker = faker { config { locale = "nb-NO" } }
// `game_of_thrones` category is not localized for `nb-NO` locale
localizedFaker.gameOfThrones.cities() // => Braavos

Java interop

Although this lib was created with Kotlin in mind it is still possible to use from a Java-based project thanks to great Kotlin-to-Java interop.

Configuring Faker:

FakerConfig fakerConfig = FakerConfigBuilder.fakerConfig(fromConsumer(builder -> {
    builder.setLocale("en-AU");
    builder.setRandom(new Random(42));
}));

If builder parameter is not called with help of fromConsumer method, then explicit return should be specified:

FakerConfig fakerConfig = FakerConfigBuilder.fakerConfig(builder -> {
    builder.setRandom(new Random(42));
    builder.setLocale("en-AU");
    return Unit.INSTANCE;
});

Calling Faker methods:

new Faker(fakerConfig).getName().firstName(); // => John

CLI

Command line application can be used for a quick lookup of faker functions. See faker-bot README for installation and usage details.

Data Providers

Below is the list of available providers that correspond to the dictionary files found in core/locales/en

Note that not all (although most) of the providers and their functions are implemented at this point. For more details see the particular .md file for each provider below.

List of available providers (clickable):

Generating a random instance of any class

There are some rules when creating a random instance of a class:

  • The constructor with the least number of arguments is used (This can be configured - read on.)
  • kotlin.collection.* and kolin.Array types in the constructor are not supported at the moment

To generate a random instance of any class use Faker().randomProvider. For example:

class Foo(val a: String)
class Bar(val foo: Foo)

class Test {
    @Test
    fun test() {
        val faker = Faker()

        val foo: Foo = faker.randomProvider.randomClassInstance()
        val bar: Bar = faker.randomProvider.randomClassInstance()
    }
}

Pre-Configuring type generation for constructor params

Some, or all, of the constructor params can be instantiated with values following some pre-configured logic using typeGenerator function. Consider the following example:

{ 0 } } } }">
class Baz(val id: Int, val uuid: UUID)

class Test {
    @Test
    fun test() {
        val faker = Faker()

        val baz: Baz = faker.randomProvider.randomClassInstance {
            typeGenerator<UUID> { UUID.fromString("00000000-0000-0000-0000-000000000000") }
            typeGenerator<Int> { 0 }
        }

    }
}

For each instance of Baz the following will be true:

baz.id == 0
baz.uuid == UUID.fromString("00000000-0000-0000-0000-000000000000")

The example itself does not make that much sense, since we're using "static" values, but we could also do something like:

val baz: Baz = faker.randomProvider.randomClassInstance {
    typeGenerator<UUID> { UUID.randomUUID() }
}

or even:

class Person(val id: Int, val name: String)

class Test {
    @Test
    fun test() {
        val faker = Faker()

        val person: Person = faker.randomProvider.randomClassInstance {
            typeGenerator<String> { faker.name.fullName() }
        }
    }
}

Deterministic constructor selection

By default, the constructor with the least number of args is used when creating a random instance of the class. This might not always be desirable and can be configured. Consider the following data classes:

class Foo
class Bar(val int: Int)
class Baz(val foo: Foo, val string: String)

class FooBarBaz {
    var foo: Foo? = null
        private set
    var bar: Bar? = null
        private set
    var baz: Baz? = null
        private set

    constructor(foo: Foo) {
        this.foo = foo
    }

    constructor(foo: Foo, bar: Bar) : this(foo) {
        this.bar = bar
    }

    constructor(foo: Foo, bar: Bar, baz: Baz) : this(foo, bar) {
        this.baz = baz
    }
}

If there is a need to use the constructor with 3 arguments when creating an instance of FooBarBaz, we can do it like so:

class Test {
    @Test
    fun test() {
        val faker = Faker()

        val fooBarBaz: FooBarBaz = randomProvider.randomClassInstance {
            constructorParamSize = 3
            fallbackStrategy = FallbackStrategy.USE_MAX_NUM_OF_ARGS
        }
    }
}

In the above example, FooBarBaz will be instantiated with the first discovered constructor that has parameters.size == 3; if there are multiple constructors that satisfy this condition - a random one will be used. Failing that (for example, if there is no such constructor), a constructor with the maximum number of arguments will be used to create an instance of the class.

Alternatively to constructorParamSize a constructorFilterStrategy config property can be used as well:

class Test {
    @Test
    fun test() {
        val faker = Faker()

        val fooBarBaz: FooBarBaz = randomProvider.randomClassInstance {
            constructorFilterStrategy = ConstructorFilterStrategy.MAX_NUM_OF_ARGS
        }
    }
}

There are some rules to the above:

  • constructorParamSize config property takes precedence over constructorFilterStrategy
  • both can be specified at the same time, though in most cases it probably makes more sense to use failbackStrategy with constructorParamSize as it just makes things a bit more readable
  • configuration properties that are set in randomClassInstance block will be applied to all "children" classes. For example classes Foo, Bar, and Baz will use the same random instance configuration settings when instances of those classes are created in FooBarBaz class.

Migrating to 1.0

Prior to version 1.0:

  • Faker was a singleton.
  • Random seed was provided through Faker.Config instance.
  • Locale was provided as parameter to init() function.
  • Provider functions were function literals. If invoke() was explicitly specified, then it will have to be removed ( See below.)

After version 1.0:

  • Faker is a class.
  • Configuration (rng, locale) is set with FakerConfig class. An instance of FakerConfig can be passed to Faker constructor.
  • Provider functions are no longer function literals. Explicit calls to invoke() will throw compilation error.

For kotlin users

- // prior to version 1.0
- Faker.Config.random = Random(42)
- Faker.init(locale)
- Faker.address.city()
- // or with explicit `invoke()`
- Faker.address.country.invoke()
+ // since version 1.0
+ // locale and random configuration is set with `FakerConfig` class (See Usage in this readme)
+ val faker = Faker(fakerConfig)
+ faker.address.city()
+ // explicit calls to `invoke()` have to be removed
+ faker.address.country()

For java users

Apart from changes to configuring locale and random seed and instantiating Faker through constructor instead of using a singleton instance (see kotlin examples), the main difference for java users is that provider functions are no longer function literals, therefore calls to invoke() operator will have to be removed and getters replaced with function calls.

- // prior to version 1.0
- Faker.init(locale);
- Faker.getAddress().getCity().invoke();
+ // since version 1.0
+ Faker faker = new Faker(fakerConfig);
+ // note `city()` function is called instead of getter 
+ // and no call to `invoke()` operator 
+ faker.getAddress().city();

For developers

Adding a new dictionary (provider)

When adding a new dictionary yml file the following places need to reflect changes:

  • Dictionary.kt - add a new class to CategoryName enum. This is only necessary if the category is not already there.
  • Constants.kt - the new dictionary filename should be added to defaultFileNames property.
  • Faker.kt - add a new faker provider property to Faker class.
  • The provider implementation class should go into provider package.
  • doc - add an .md file for the new provider.
  • reflect-config.json has to be updated to build the native image with graal.
  • And of course unit tests.

Test

To run unit tests: ./gradlew clean test

To run integration tests: ./gradlew clean integrationTest

Build and Deploy

To deploy to OSS Sonatype repo:

  • set the following properties in ~/.gradle/gradle.properties
    • signing.keyId=
    • signing.password=
    • signing.secretKeyRingFile=/home/user/.gnupg/secring.gpg
    • sonatypeUsername=
    • sonatypePassword=
    • stagingProfileId=
  • running publishFakerCorePublicationToSonatypeRepository will publish the artifacts to either staging release repo or to snapshots repo, depending on the current version

Bumping versions

Versions need to be bumped manually through a tag with the next release version that has to follow the semver rules, and the tag has to be pushed to origin.

Creating the tag can be either done manually with git tag or by using gradlew tag task.

Pre-releases

To create a new pre-release version (new release candidate) the following can be used: ./gradlew clean tag -Prelease -PnewPreRelease -PbumpComponent={comp}, where comp can be one of the following values: major, minor, or patch.

To bump an existing pre-release to the next version (next release candidate for the same release version) the following can be used: ./gradlew clean tag -Prelease -PpreRelease.

Releases

To promote a pre-release to a release version the following can be used: ./gradlew clean tag -Prelease -PpromoteToRelease,

To create a new release version the following can be used: ./gradlew clean tag -Prelease -PbumpComponent={comp}, where comp can be one of the following values: major , minor, or patch.

Make targets

Alternatively to the above targets from Makefile can be used for the same purposes.

Contributing

The CONTRIBUTING guidelines should help in getting you started on how to contribute to this project.

Thanks

Many thanks to these awesome tools that help us in creating open-source software:
Intellij IDEA YourKit Java profiler

Licence

This code is free to use under the terms of the MIT licence. See LICENCE.md.

Comments
  • Problems with Fasterxml 2.10.0 and Springboot 2.2.1

    Problems with Fasterxml 2.10.0 and Springboot 2.2.1

    I cannot use Faker with my latest Springboot project (2.2.1.RELEASE)

    java.lang.NoSuchMethodError: com.fasterxml.jackson.module.kotlin.KotlinModule.<init>(IZZZILkotlin/jvm/internal/DefaultConstructorMarker;)V
    
    	at io.github.serpro69.kfaker.Mapper.<clinit>(Mapper.kt:12)
    	at io.github.serpro69.kfaker.FakerService.readCategory(FakerService.kt:121)
    	at io.github.serpro69.kfaker.FakerService.load(FakerService.kt:65)
    	at io.github.serpro69.kfaker.FakerService.<init>(FakerService.kt:30)
    	at io.github.serpro69.kfaker.Faker.<init>(Faker.kt:13)
    	at io.github.serpro69.kfaker.Faker.<init>(Faker.kt:12)
    

    I fixed it by upgrading fasterxml to 2.10.1.

    opened by ksinkar 11
  • Add namedParameterGenerator for RandomProvider#randomClassInstance

    Add namedParameterGenerator for RandomProvider#randomClassInstance

    Faker provides the ability to create a random object instance for a specific type, and to override the generation of the object's fields by type as described in this example from the documentation:

    class Baz(val id: Int, val uuid: UUID)
    
    val baz: Baz = faker.randomProvider.randomClassInstance {
        typeGenerator<UUID> { UUID.fromString("00000000-0000-0000-0000-000000000000") }
    }
    

    This is great, but sometimes the objects we generate are required to be related in a way that makes overriding by type not granular enough. For example, if an object of one class must hold an ID of an object of another class, generation by type would not allow us to form a valid relationship.

    class Foo(val id: Int, val bazId: Int)
    
    val foo: Foo = faker.randomProvider.randomClassInstance {
        typeGenerator<Int> { 42 }
    }
    
    

    Here bazId should be set equal to baz.id, but instead both id and bazId will be 42 and (unless I'm mistaken) a mechanism doesn't exist to assign a specific yet different value to fields of the same type.

    One way to solve this problem would be to provide a way to override field generation not by type but by constructor parameter name, as in this example:

    val foo: Foo = faker.randomProvider.randomClassInstance {
        namedParameterGenerator("bazId") { baz.id }
    }
    

    This is what is implemented in this PR. Looking forward to hearing your thoughts on whether this is a worthwhile addition, or if there is a better way to achieve my aims.

    enhancement :rocket: core :zero::one: 
    opened by humblehacker 7
  • Could not initialize class io.github.serpro69.kfaker.Mapper

    Could not initialize class io.github.serpro69.kfaker.Mapper

    Hello,

    I got an exception with version 1.7.*. I'm just doing:

    private val faker = io.github.serpro69.kfaker.Faker()
    

    I'm running faker inside tests with SpringBoot. I don't have the time for a reproduction repository but tell me if you don't find how to reproduce the bug.

    Note: the version 1.6.0 is working fine for me.

    Stacktrace

    Could not initialize class io.github.serpro69.kfaker.Mapper
    java.lang.NoClassDefFoundError: Could not initialize class io.github.serpro69.kfaker.Mapper
    	at io.github.serpro69.kfaker.FakerService.readCategory(FakerService.kt:170)
    	at io.github.serpro69.kfaker.FakerService.load(FakerService.kt:68)
    	at io.github.serpro69.kfaker.FakerService.<init>(FakerService.kt:35)
    	at io.github.serpro69.kfaker.Faker.<init>(Faker.kt:14)
    	at io.github.serpro69.kfaker.Faker.<init>(Faker.kt:13)
    	at io.adfinitas.webhook.controller.WebhookControllerTests.<init>(WebhookControllerTests.kt:51)
    	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    	at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:64)
    	at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    	at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500)
    	at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481)
    	at org.junit.platform.commons.util.ReflectionUtils.newInstance(ReflectionUtils.java:513)
    	at org.junit.jupiter.engine.execution.ConstructorInvocation.proceed(ConstructorInvocation.java:56)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
    	at org.junit.jupiter.api.extension.InvocationInterceptor.interceptTestClassConstructor(InvocationInterceptor.java:72)
    	at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
    	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
    	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
    	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:77)
    	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestClassConstructor(ClassBasedTestDescriptor.java:342)
    	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateTestClass(ClassBasedTestDescriptor.java:289)
    	at org.junit.jupiter.engine.descriptor.ClassTestDescriptor.instantiateTestClass(ClassTestDescriptor.java:79)
    	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:267)
    	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$2(ClassBasedTestDescriptor.java:259)
    	at java.base/java.util.Optional.orElseGet(Optional.java:362)
    	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$3(ClassBasedTestDescriptor.java:258)
    	at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:31)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:101)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:100)
    	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:65)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$1(NodeTestTask.java:111)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:111)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:79)
    	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    	at java.base/java.util.ArrayList.forEach(ArrayList.java:1511)
    	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:38)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$5(NodeTestTask.java:143)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$7(NodeTestTask.java:129)
    	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:127)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:126)
    	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:84)
    	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:32)
    	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
    	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:51)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:108)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
    	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
    	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:96)
    	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:75)
    	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:99)
    	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:79)
    	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:75)
    	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
    	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
    	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:94)
    	at com.sun.proxy.$Proxy2.stop(Unknown Source)
    	at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:133)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
    	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
    	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
    	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
    	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:182)
    	at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:164)
    	at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:414)
    	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
    	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
    	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
    	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
    	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
    	at java.base/java.lang.Thread.run(Thread.java:832)
    

    bug :lady_beetle: core :zero::one: 
    opened by scorsi 7
  • Application crash. Regex syntax error

    Application crash. Regex syntax error

    v1.12.0-rc.0 Use simple init:

    val config = fakerConfig { locale = "en" }
    val faker = Faker(config)
    

    Get error: Caused by: java.util.regex.PatternSyntaxException: Syntax error in regexp pattern near index 26 #{(?!\d)(\p{L}+.)?(.*?)}

    If I use v1.11.0 - no exception occurs

    bug :lady_beetle: core :zero::one: 
    opened by Gizmodo 6
  • JPMS: Wrong export in module-info

    JPMS: Wrong export in module-info

    I am using JPMS and unable to import faker classes and they are not exported. Instead I see wrong exports in the decompiled class. PFA the screenshot

    module com.fasterxml.jackson.annotation {
        exports com.fasterxml.jackson.annotation;
    
        opens com.fasterxml.jackson.annotation;
    }
    
    Screenshot 2022-08-01 at 10 48 23 bug :lady_beetle: core :zero::one: 
    opened by overfullstack 5
  • Update to Kotlin 1.4.31 and Jackson 2.12.1

    Update to Kotlin 1.4.31 and Jackson 2.12.1

    I recently update the dependencies in a project of mine to Kotlin 1.4.31 and Jackson >= 2.12.

    This in fact leads to a NoClassDefFound Exception at the Mapper class of Faker. To be precise at this line:

        init {
            mapper.registerModule(KotlinModule())
        }
    

    So I would highly appreciate an updated version with updated dependencies! Thanks a lot!

    core :zero::one: 
    opened by PeekAndPoke 5
  • (safe)Email sometimes creates invalid email addresses (for certain locales?)

    (safe)Email sometimes creates invalid email addresses (for certain locales?)

    Sometimes we encountered emails that cannot be validated as valid email address when using faker.internet.email() or with faker.internet.safeEmail() when using certain locales, for example nl-NL.

    I used Valiktor to test emails:

        @RepeatedTest(100)
        fun `test email validity`() {
            try {
                val email = Email(faker.internet.email())
                org.valiktor.validate(email) {
                    validate(Email::value).isEmail()
                }
            } catch (e: ConstraintViolationException) {
                fail {
                    val error = e.constraintViolations
                        .mapToMessage(baseName = "messages")
                        .associate { it.property to "${it.message}, but was '${it.value}'" }
                    "Error: $error"
                }
            }
        }
    
        data class Email(val value: String) {
            init {
                validate(this) {
                    validate(Email::value).isEmail()
                }
            }
        }
    

    This generated email addresses like jurrië[email protected], msc.cil.ahmetović@hotmail.nl and chrisje.van.'[email protected].

    invalid :no_entry_sign: core :zero::one: 
    opened by martinvisser 4
  • Function areaCode not found

    Function areaCode not found

    When using locale "en-US" getting Function areaCode not found

    val config = fakerConfig { locale = "en-US" }
    val phoneNumber = Faker(config).phoneNumber.cellPhone()
    
    opened by anefedov 4
  • Fake name not working

    Fake name not working

    Version: 1.12.0

    Since 1.12.0, when I try to fake a name, I always get this exception. In 1.11.0 it worked:

    null cannot be cast to non-null type kotlin.collections.Map<*, *>
    java.lang.NullPointerException: null cannot be cast to non-null type kotlin.collections.Map<*, *>
    	at io.github.serpro69.kfaker.FakerService.readCategoryOrNull(FakerService.kt:293)
    	at io.github.serpro69.kfaker.FakerService.access$readCategoryOrNull(FakerService.kt:38)
    	at io.github.serpro69.kfaker.FakerService$load$1.invoke(FakerService.kt:240)
    	at io.github.serpro69.kfaker.FakerService$load$1.invoke(FakerService.kt:201)
    	at io.github.serpro69.kfaker.FakerService.load$lambda$10(FakerService.kt:201)
    	at java.base/java.util.Map.compute(Map.java:1171)
    	at io.github.serpro69.kfaker.FakerService.load$core(FakerService.kt:201)
    	at io.github.serpro69.kfaker.FakerService.load$core$default(FakerService.kt:198)
    	at io.github.serpro69.kfaker.provider.Name.<init>(Name.kt:18)
    	at io.github.serpro69.kfaker.Faker$name$2.invoke(Faker.kt:162)
    	at io.github.serpro69.kfaker.Faker$name$2.invoke(Faker.kt:162)
    	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:74)
    	at io.github.serpro69.kfaker.Faker.getName(Faker.kt:162)
    

    My code (reduced):

    private val faker = Faker(config = fakerConfig { locale = "de-DE" })
    faker.name.firstName()
    

    Is this a bug or a feature?

    bug :lady_beetle: core :zero::one: 
    opened by Ragin-LundF 4
  • Provide quick (unique) numerify, letterify, bothify and regexify providers

    Provide quick (unique) numerify, letterify, bothify and regexify providers

    With JavaFaker, it's possibly to quickly generate strings or numbers with numerify, letterify, bothify and regexify. It's a little hidden, only documented in the javadoc.

    numerify replaces # with numbers in a string, letterify replaces ? with uppercase lettrs in a string, and bothify does both. regexify generates a string that matches the a given regular expression.

    It would be nice if those were availablein kotlin-faker too, especially if they could also be made unique.

    I see the FakerService does have numerify, letterify and generexify, but it seems those are only used for implementing the various providers, and not meant to be used directly?

    Basically, it would be great to just write something like,

    List(100) { faker.unique.letterify("foo???bar") }
    

    If I could, I would just add the following locally, but FakerService and AbstractFakeDataProvider are package internal.

    class Template constructor(fakerService: FakerService) : AbstractFakeDataProvider<Template>(fakerService) {
        override val categoryName = "Template"
        override val localUniqueDataProvider = LocalUniqueDataProvider<Template>()
        override val unique by UniqueProviderDelegate(localUniqueDataProvider)
    
        fun numerify(template: String) = with(fakerService) { template.numerify() }
        fun letterify(template: String) = with(fakerService) { template.letterify() }
        fun bothify(template: String) = with(fakerService) { template.letterify().numerify() }
        fun regexify(template: String) = with(fakerService) { template.generexify() }
    }
    

    Is there a way to add a custom provider like that without having to reference internal classes?

    enhancement :rocket: core :zero::one: 
    opened by darioseidl 4
  • Generating random Double, Int or Float?

    Generating random Double, Int or Float?

    I'm probably missing the obvious, but I've been looking for a way to generate a random Double, Int or Float with kotlin-faker and I haven't been able to find it.

    Is there a way to generate these values with kotlin-faker or should the builtin Random class be used for these values?

    I did see this post which uses faker.randomService.nextInt(1, 100), but that doesn't seem to be available.

    I'm using Kotlin 1.5.0, kotlin-faker 1.7.1 and kotest 4.4.3

    enhancement :rocket: core :zero::one: 
    opened by johanvergeer 4
  • Parameter 'cities' not found in 'address' category

    Parameter 'cities' not found in 'address' category

    https://github.com/serpro69/kotlin-faker/issues/87#issue-908678179

    val config = fakerConfig { locale = "en-ZA" } 
    val faker = Faker(config)
    println(faker.address.city())
    
    needs info :question: core :zero::one: 
    opened by oshmykova 2
  • Switch from Orchid to XXX

    Switch from Orchid to XXX

    Orchid was fun to work with, but even though it works fine for the most part, it has been unmaintained for quite awhile (last commit on 2021-08-08).

    The bigger problem is that it was using jcenter to host artifacts and never moved to maven central or any other repo (see https://github.com/orchidhq/Orchid/issues/393 ), hence a move to another documentation framework is more of a "must" than a "should".

    A few options to consider:

    • hugo
    • mkdocs
    • docusaurus
    docs :page_with_curl: 
    opened by serpro69 0
  • graal: Discovered unresolved method during parsing: java.nio.ByteBuffer.rewind()

    graal: Discovered unresolved method during parsing: java.nio.ByteBuffer.rewind()

    Error: com.oracle.graal.pointsto.constraints.UnresolvedElementException: Discovered unresolved method during parsing: java.nio.ByteBuffer.rewind(). To diagnose the issue you can use the --allow-incomplete-classpath option. The missing method is then reported at run time when it is accessed the first time.
    Detailed message:
    [faker-bot_0.0.0:615210]      [total]Trace:
    :  19,156.22 ms,  3.22 GB
            at parsing faker.com.fasterxml.jackson.databind.ser.std.ByteBufferSerializer.serialize(ByteBufferSerializer.java:31)
    Call path from entry point to faker.com.fasterxml.jackson.databind.ser.std.ByteBufferSerializer.serialize(ByteBuffer, JsonGenerator, SerializerProvider):
            at faker.com.fasterxml.jackson.databind.ser.std.ByteBufferSerializer.serialize(ByteBufferSerializer.java:22)
            at faker.com.fasterxml.jackson.databind.ser.std.ByteBufferSerializer.serialize(ByteBufferSerializer.java:13)
            at faker.com.fasterxml.jackson.databind.ser.DefaultSerializerProvider._serialize(DefaultSerializerProvider.java:468)
            at faker.com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:353)
            at faker.com.fasterxml.jackson.databind.ObjectWriter$Prefetch.serialize(ObjectWriter.java:1516)
            at faker.com.fasterxml.jackson.databind.ObjectWriter._writeValueAndClose(ObjectWriter.java:1219)
            at faker.com.fasterxml.jackson.databind.ObjectWriter.writeValueAsString(ObjectWriter.java:1086)
            at faker.com.fasterxml.jackson.databind.node.InternalNodeMapper.nodeToString(InternalNodeMapper.java:30)
            at faker.com.fasterxml.jackson.databind.node.BaseJsonNode.toString(BaseJsonNode.java:136)
            at java.lang.String.valueOf(String.java:2994)
            at java.nio.charset.IllegalCharsetNameException.<init>(IllegalCharsetNameException.java:55)
            at java.nio.charset.Charset.checkName(Charset.java:303)
            at com.oracle.svm.core.jdk.localization.substitutions.Target_java_nio_charset_Charset.lookup(Target_java_nio_charset_Charset.java:77)
            at java.nio.charset.Charset.isSupported(Charset.java:505)
            at com.oracle.svm.jni.JNIJavaCallWrappers.jniInvoke_VA_LIST:Ljava_nio_charset_Charset_2_0002eisSupported_00028Ljava_lang_String_2_00029Z(generated:0)
    
    Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
    # Printing build artifacts to: /home/sergio/Projects/personal/personal/kotlin-faker/cli-bot/build/graal/faker-bot_0.0.0.build_artifacts.txt
    Error: Image build request failed with exit status 1
    

    seems to be caused by a recent jackson version update - https://github.com/serpro69/kotlin-faker/commit/3d5f71ae540b8a3d7e45905b8df568c8ca435263 build run - https://github.com/serpro69/kotlin-faker/actions/runs/3303548647

    bug :lady_beetle: bot :robot: 
    opened by serpro69 1
  • Add support for using <lang> dict when <lang-COUNTRY> dict is missing

    Add support for using dict when dict is missing

    This was removed in #129 ( https://github.com/serpro69/kotlin-faker/commit/3a9dde0a95017299fecbbdd1a45148ce555db5b8 ) due to changes in fr and ja dicts - they became directories rather than single files. Therefore it got a bit complicated to handle cases like:

    faker {
      fakerConfig {
        locale = "fr-FR"
      }
    }
    

    where fr-FR.yml does not exist and would default to using fr.yml

    enhancement :rocket: core :zero::one: 
    opened by serpro69 0
  • Add functions for Source provider

    Add functions for Source provider

    https://github.com/serpro69/kotlin-faker/blob/8a1abbba1ab30692a2147147ee31fd1194315e59/core/src/main/kotlin/io/github/serpro69/kfaker/provider/Source.kt#L12 does not have any functions implemented

    enhancement :rocket: good first issue :hammer: core :zero::one: 
    opened by serpro69 0
  • New 'git' provider

    New 'git' provider

    A Git provider class could be used to create "fake" (read - temporary) local git repositories for testing purposes.

    Note: this should probably be a separate module, not part of core faker, as it will require jgit dependency (or will have jgit bundled?)

    enhancement :rocket: 
    opened by serpro69 0
Releases(v1.13.0)
  • v1.13.0(Dec 17, 2022)

    Added

    • #164 Add possibility to configure RandomClassProvider on higher levels
    • #165 Add copy and new functions to RandomClassProvider

    Changed

    • #159 Change format of dictionary files from yml to json

    Fixed

    • #161 Fix empty lists as parameter values
    • #171 Fix locale fallback
    • #173 Fix phoneNumber generation for en-US locale

    Other

    • #168 Reduce faker’s shadowed jar size
    Source code(tar.gz)
    Source code(zip)
    faker-bot_1.13.0(35.19 MB)
    faker-bot_1.13.0.jar(12.70 MB)
  • v1.13.0-rc.4(Dec 12, 2022)

  • v1.13.0-rc.3(Nov 27, 2022)

  • v1.13.0-rc.2(Nov 5, 2022)

  • v1.13.0-rc.1(Nov 5, 2022)

  • v1.13.0-rc.0(Oct 30, 2022)

  • v1.12.0(Oct 16, 2022)

    Added

    • #134 Overload RandomService#randomSublist and RandomService#randomSubset with sizeRange parameter
    • #144 Add index and punctuation chars support to RandomService#randomString
    • #154 New CryptographyProvider for generating random sha sums
    • #155 [core] Update dictionary files, including:
      • Data and functions in existing data providers
      • Updates to existing localized dictionaries
      • New Data Providers:
        • hackers
        • mountaineering
        • sport
        • tarkov

    Changed

    • #135 Initialize Faker data providers lazily

    Fixed

    • #136 Parameter 'streets' not found in 'ADDRESS' category
    • #137 Parameter 'category' not found in 'COMPANY' category for 'ja' locale
    • #138 Parameter 'zip_code' not found in 'ADDRESS' category for 'fr' locale
    • #140 Fix NPE when generating CurrencySymbol with non 'en' locale
    • #142 Fix unique localized category keys missing from dictionary
    • #146 Fix RandomService#randomString for some eng-lang locales
    • #148 Fix StarWars quotes by character (thanks @TZanke )

    Docs

    • #130 Document how to add new data providers
    Source code(tar.gz)
    Source code(zip)
    cli-bot-1.12.0-fat.jar(39.03 MB)
    faker-bot_1.12.0(36.79 MB)
  • v1.12.0-rc.2(Aug 11, 2022)

  • v1.12.0-rc.1(Aug 11, 2022)

  • v1.12.0-rc.0(Jul 11, 2022)

    Added

    • https://github.com/serpro69/kotlin-faker/pull/134 Overload RandomService#randomSublist and RandomService#randomSubset with sizeRange parameter
    • https://github.com/serpro69/kotlin-faker/pull/144 Add index and punctuation chars support to RandomService#randomString

    Changed

    • https://github.com/serpro69/kotlin-faker/pull/135 Initialize Faker data providers lazily

    Fixed

    • https://github.com/serpro69/kotlin-faker/issues/140 Fix NPE when generating CurrencySymbol with non 'en' locale
    • https://github.com/serpro69/kotlin-faker/pull/142 Fix unique localized category keys missing from dictionary
    • https://github.com/serpro69/kotlin-faker/issues/136 Parameter 'streets' not found in 'ADDRESS' category
    • https://github.com/serpro69/kotlin-faker/issues/137 Parameter 'category' not found in 'COMPANY' category for 'ja' locale
    • https://github.com/serpro69/kotlin-faker/pull/146 Fix RandomService#randomString for some eng-lang locales

    Docs

    • https://github.com/serpro69/kotlin-faker/pull/130 Document how to add new data providers
    Source code(tar.gz)
    Source code(zip)
    cli-bot-1.12.0-rc.0-fat.jar(38.28 MB)
    faker-bot_1.12.0-rc.0(36.61 MB)
  • v1.11.0(May 22, 2022)

    Added

    • #122 [core] Add (unique) numerify, letterify, bothify and regexify functions through StringProvider

    • #129 [core] Update dictionary files, including:

      • New data and functions in existing data providers

      • New data providers:

        • adjective
        • australia
        • bible
        • bird
        • brooklynNineNine
        • camera
        • clashOfClans
        • conan
        • doraemon
        • emotion
        • finalSpace
        • fmaBrotherhood
        • hobby
        • howToTrainYourDragon
        • jackHandey
        • kamenRIder
        • mountain
        • naruto
        • room
        • studioGhibli
        • superMario
        • supernatural
        • tea
        • theKingkillerChronicle
        • theOffice
        • tolkien
        • touhou
        • tron
        • volleyball

      • Updates to existing localized dictionaries
        • Especially notable for fr and ja locales as they now, similarly to en locale, contain multiple dict files per locale
      • New localized dictionaries for es-AR, lt and mi-NZ locales

    Changed

    • Some functions will now accept enum-typed parameters instead of strings
    • Add deprecation warnings to some functions due to upstream changes in yml dict files

    Fixed

    • #125 [core] Generating postcode with locale "nl" gives back expression rather than result
    Source code(tar.gz)
    Source code(zip)
    cli-bot-1.11.0-fat.jar(22.58 MB)
    faker-bot_1.11.0(36.19 MB)
  • v1.10.0(Feb 20, 2022)

  • v1.9.0(Nov 19, 2021)

    Added

    • #103 [core] Add support for Collection types in RandomProvider#randomClassInstance
    • #96 [core] Add randomSubset and randomSublist to RandomService
    • #92 [core] Add randomString function to RandomService
    • #86 [core] Generate birth-date based on the age

    Changed

    • #108 Update kotlin to 1.6.0
    • #100 [core] Add deprecation warning for RandomService#nextString since it's going to be replaced with RandomService#randomString
    • #97 [core] Change RandomService#nextString to generate strings only within given locale

    Fixed

    • #104 [core] RandomProvider#randomClassInstance : 'No suitable constructor found' for primitive classes
    Source code(tar.gz)
    Source code(zip)
    cli-bot-1.9.0.jar(21.98 MB)
    faker-bot_1.9.0(32.46 MB)
  • v1.8.0(Oct 3, 2021)

    Added

    • #67 [core] Access to RandomService through Faker for generating random Int, Double, Float, etc.
    • #77 [core] Extra functionality to RandomService - nextEnum(), nextUUID(), nextLong(bound) functions.
    • #69 [core] Passing seed directly to FakerConfig instead of through java.util.Random instance
    • #71 [core] DSL for creating and configuring Faker
    • #78 [core] Support sealed classes in RandomProvider#randomClassInstance fun
    • #88] [core] Postpone initialization of FakerConfig through the Builder

    Changed

    • Configurable length of the string generated with RandomService#nextString

    Fixed

    • #65 [core] Could not initialize class io.github.serpro69.kfaker.Mapper with SpringBoot 2.4.x
    • #60 [core] Move out of Bintray/Jcenter
    • #79 [core] java.lang.NoClassDefFoundError: org/yaml/snakeyaml/error/YAMLException
    • #81 [core] RandomProvider#randomClassInstance fails for object types
    • #90 [core] Android java.lang.NoClassDefFoundError: FakerService$$ExternalSyntheticLambda1
    • #87 [core] Parameter 'city_root' not found in 'address' category
    • #89 [core] Parameter 'male_last_name' not found in 'name' category for "ru" locale
    Source code(tar.gz)
    Source code(zip)
    cli-bot-1.8.0.jar(8.78 MB)
    faker-bot_1.8.0(32.76 MB)
  • v1.7.1(Apr 28, 2021)

  • v1.7.0(Apr 16, 2021)

  • v1.6.0(Dec 30, 2020)

    Added

    • #44 [core] Add support for random instance configuration.
    • #47 [core] Publish release candidates to bintray
    • #49 [core] Unique values exclusions with wildcards
    • #46 [core] Support deterministic constructor selection for randomClassInstance

    Fixed

    • #26 [core] Parameter '4' not found in 'vehicle' category
    • #48 [core] streetFighter#moves: class java.util.LinkedHashMap cannot be cast to class java.lang.String
    • #50 [core] Horseman spelt wrong
    • #56 [core] Values with single '?' char are not always letterified

    Changed

    • #49 [core] Configuration for generation of unique values. Old functionality is deprecated and will be removed in future releases.
    Source code(tar.gz)
    Source code(zip)
    faker-bot_1.6.0(30.59 MB)
  • v1.6.0-rc.3(Dec 24, 2020)

  • v1.6.0-rc.2(Dec 20, 2020)

  • v1.6.0-rc.1(Dec 13, 2020)

    Added

    • #49 [core] Unique values exclusions with wildcards

    Fixed

    • #48 [core] streetFighter#moves: class java.util.LinkedHashMap cannot be cast to class java.lang.String

    Changed

    • [core] Configuration for generation of unique values. Old functionality is deprecated and will be removed in future releases. This relates to changes in #49
    Source code(tar.gz)
    Source code(zip)
    faker-bot_1.6.0-rc.1(30.58 MB)
  • v1.6.0-rc.0(Nov 14, 2020)

  • v1.5.0(Aug 30, 2020)

    Added

    • #40 [core] Add enum support for RandomProvider
    • #39 [core] Update dict files.
      • Including new functions in existing providers:
        • aquaTeenHungerForce.quote()
        • dnd.cities()
        • dnd.languages()
        • dnd.meleeWeapons()
        • dnd.monsters()
        • dnd.races() - replaces deprecated species() function.
        • dnd.rangedWeapons()
        • heroesOfTheStorm.classNames() - replaces deprecated classes() function
        • movie.title()
        • name.neutralFirstName()
        • phish.albums()
        • phish.musicians()
        • phish.songs() - replaces deprecated song() function
        • simpsons.episodeTitles()
      • Including new faker providers:
        • barcode
        • bigBangTheory
        • drivingLicense
        • drone
        • futurama
        • minecraft
        • prince
        • rush
        • streetFighter

    Changed

    • #32 Upgrade kotlin to 1.4.0
    Source code(tar.gz)
    Source code(zip)
    faker-bot_1.5.0(30.56 MB)
  • v1.4.1(Aug 22, 2020)

  • v1.4.0(Jul 9, 2020)

  • v1.3.1(Jun 7, 2020)

  • v1.3.0(Jun 3, 2020)

  • v1.2.0(Jul 9, 2020)

    Added

    • 3 new providers: chiquito, computer, and rajnikanth
    • New functions to existing providers:
      • address.cityWithState()
      • address.mailbox()
      • gender.shortBinaryTypes()
    • educator provider changed completely due to new dict file structure
    • Upgrades to existing dict files
    • Automated versioning (patches only) and deploys

    Fixed

    • #18 Visibility of randomClassInstance() function in RandomProvider class
    • #20 Issues with FasterXML Jackson 2.10.1
    Source code(tar.gz)
    Source code(zip)
Owner
Sergii Prodan
QA engineer by calling, serendipitously became a developer by day. Automation for all things made with love and tea during sleepless nights @ Milliways.
Sergii Prodan
An application that allows the user to update variety of smartphones that are used such as iPhone and Android

PhoneApplication An application that allows the user to update variety of smartphones such as iPhone and Android. This application allows users to add

Pankaj Singh 1 Nov 28, 2021
Simple application showing wallets fetched from fake services

LittleWallet Resume Simple application showing wallets fetched from fake services. User can filter wallets by currency types and click to enter a deta

null 0 Nov 15, 2021
Integration Testing Kotlin Multiplatform Kata for Kotlin Developers. The main goal is to practice integration testing using Ktor and Ktor Client Mock

This kata is a Kotlin multiplatform version of the kata KataTODOApiClientKotlin of Karumi. We are here to practice integration testing using HTTP stub

Jorge Sánchez Fernández 29 Oct 3, 2022
An Android app where you can view and examine the details of fast food divided into categories.

?? FastFood An Android application where you can view and examine the details of fast food divided into categories. ?? Tech Stack & Open-Source Librar

Muhammed Esad Cömert 3 Oct 7, 2022
Used to generate the template code of GetX framework

Language: English | 中文简体 statement some fast code snippet prompt come from getx-snippets-intelliJ Description install Plugin effect Take a look at the

小呆呆666 242 Dec 30, 2022
A Kotlin library used to analyse discrete Markov chains, in order to generate plausible sequences

Markov Markov is a Kotlin library used to analyse discrete Markov chains, in order to generate plausible sequences. Using This project is still under

Xavier F. Gouchet 0 Nov 14, 2021
XliteKt is an open-source, and forever open-source Kotlin based OSRS Emulator for educational purposes.

xlitekt Introduction XliteKt is an open-source, and forever open-source Kotlin based OSRS Emulator for educational purposes. Currently built around th

Runetopic 6 Dec 16, 2022
Collection of various algorithms in mathematics, computer science etc implemented in Kotlin for educational purposes.

The Kotlin Algorithms Implementation of different algorithms and data structures using Kotlin lang Overview The repository is a collection of open-sou

Oleksii Shtanko 9 Aug 1, 2022
Binding your extras more easier, more simpler for your Android project

Ktan Ktan make your intent / arguments more easier and readable. And most important, will help you bind all extras for your activity / fragment. And a

Ade Fruandta 3 Jan 7, 2023
A library that extends the existing JDBC API so that data objects can be used as input (to set parameters) and output (from ResultSet's rows).

SqlObjectMapper This is a library that extends the existing JDBC API so that data objects can be used as input (to set parameters) and output (from Re

Qualified Cactus 2 Nov 7, 2022
A simple store project that includes a list of products, search on products, details of the product, and review submission.

AdidasTest A simple store project that includes a list of products, search on products, details of the product, and review submission. Summary Technol

Mohammad 5 May 8, 2021
Astronomy Picture of the Day Nasa(APOD) media listing and show picture details.

Astronomy Picture of the Day Nasa(APOD) media listing and show picture details. Built to learn and use of Latest Android development libs using Coroutines, Flow, Dagger-Hilt, Architecture Components, MVVM, Room, Retrofit, Material Guideline)

pRaNaY 5 Oct 18, 2022
Track RPG Playthrough Details

Shattered Ring Tracker This project is an RPG game tracker where the user can keep a journal of details about their game, including: NPCs Track the NP

Nathan Contino 1 Mar 16, 2022
Praveen Kumar Kumaresan 0 Jan 17, 2022
FlowExt is a Kotlin Multiplatform library, that provides many operators and extensions to Kotlin Coroutines Flow

FlowExt | Kotlinx Coroutines Flow Extensions | Kotlinx Coroutines Flow Extensions. Extensions to the Kotlin Flow library | kotlin-flow-extensions | Coroutines Flow Extensions | Kotlin Flow extensions | kotlin flow extensions | Flow extensions

Petrus Nguyễn Thái Học 151 Jan 1, 2023
Open-Source Forge 1.8.9 Hypixel Duels bot! Planned to support many modes and written in Kotlin.

This project has been moved to a new repository: [HumanDuck23/duck-dueller-v2](https://github.com/HumanDuck23/duck-dueller-v2) Duck Dueller Are you ti

null 2 Aug 29, 2022
Kotlin script to prevent invalid conversion errors in projects with many localization files

Localization-Patterns-Checker Kotlin script to prevent invalid conversion errors

Бырна Алексей 1 Dec 26, 2021
Team management service is a production ready and fully tested service that can be used as a template for a microservices development.

team-mgmt-service Description Team management service is a production ready and fully tested service that can be used as a template for a microservice

Albert Llousas Ortiz 18 Oct 10, 2022
Tweaks - A customizable debug screen to view and edit flags that can be used for development

A customizable debug screen to view and edit flags that can be used for developm

Telefónica 10 Jun 28, 2022