A utility to make Kotlin/Java tests random yet reproducible

Overview

Elmyr

Elmyr is a Kotlin library providing tools to generate “random” values, specifically useful for tests

Release Documentation Status

Build Status codecov

license Donate

Being an adept of testing code, I write a lot of tests. One thing I noticed is that in my tests, my fake / test data always look the same. My user names are always “Bob” and “Alice”, aged 42 or 69, with userId 4816152342 or 24601, and eating “spam”, “eggs” and “bacon”.

The problem is, the more test I write, the less I'm confident in my fake values, because they're always the same.

This is where Elmyr kicks in, allowing you to create fake/fuzzy data based on a few constraints, making your test data random, and yet reproducible.

Usage

Gradle

    repositories {
        maven { url "https://jitpack.io" }
    }
    dependencies {
        testCompile("com.github.xgouchet.Elmyr:core:x.x.x")
        testCompile("com.github.xgouchet.Elmyr:junit4:x.x.x")
        testCompile("com.github.xgouchet.Elmyr:junit5:x.x.x")
        testCompile("com.github.xgouchet.Elmyr:jvm:x.x.x")
    }

Forging data: the core module

You can create an instance of the Forge class, and from that generate:

  • primitives, with basic constraints
  • Strings matching simple predicates or even Regexes
  • Your own custom data, by implementing the ForgeryFactory interface, then calling the Forge::addFactory method.

ForgeRule for junit4

You can instantiate a ForgeRule instance, which extends the Forge class, add factories to it, and then annotate fields on your test class with @Forgery.

class FooTest {

    @get:Rule
    val forge = ForgeRule()
            .withFactory(FooFactory())
            .withFactory(BarFactory())

    @Forgery
    internal lateinit var fakeBar: Bar

    @Forgery
    lateinit var fakeFooList: List<Foo>

    //
}

ForgeExtension for junit5

You can add an extension and configure it. In addition to creating forgeries on fields/properties of your test class, you can inject parameters directly on your test methods.

@ExtendWith(ForgeExtension::class)
@ForgeConfiguration(KotlinAnnotationTest.Configurator::class)
internal class FooTest {

    @Forgery
    internal lateinit var fakeBar: Bar

    @Forgery
    lateinit var fakeFooList: List<Foo>

    @Test
    fun testSomething(@IntForgery i: Int, forge:Forge){
        //
    }
}

spek forgeries

You can create a custom Forge instance with spekForge to be able to add reproducibility to Spek tests.

class CalculatorSpek : Spek({

    val forge = spekForge(
        seeds = mapOf(
            "CalculatorSpek/A calculator/addition/returns the sum of its arguments" to 0x1337L
        )
    )

    describe("A calculator") {
        val calculator by memoized { Calculator() }
        
        describe("addition") {
            it("returns the sum of its arguments") {
                val a = forge.anInt()
                val b = forge.anInt()
                assertEquals(calculator.add(a, b), a + b)
            }
        }
    }
})

Documentation

The full documentation will be coming shortly

Contributing

Contribution is fully welcome. Before submitting a Pull Request, please verify you comply with the following checklist :

  • All public classes, methods and fields must be documented
  • All code must be unit tested (duh…)
  • All code should be usable with and without the Android SDK, from Java and Kotlin

Release History

Latest Release: 1.3.1 (2021/09/07)

core

  • Fix some invalid regex forgeries (e.g.: "[^a-z]+" was not handled properly)

junit5

  • Fix an error when a ForgeConfiguration was missing a ForgeConfigurator

Donate

This library is completely free to use and modify (as per the License). I try my best to make it as good as possible, but only do this on my free time. If you want to support my work, you can click the Donate button below.

paypal

Meta

Xavier F. Gouchet – @xgouchet

Distributed under the MIT license. See LICENSE.md for more information.

https://github.com/xgouchet/Elymr

Comments
  • Can not set a seed with the default ForgeConfigurator

    Can not set a seed with the default ForgeConfigurator

    Hi,

    I was just testing your lovely library after watching this video on youtube, and just got an error : I can not replay a test with a seed and the default ForgeConfigurator. It also happen with just @ForgeConfiguration (no seed and no Configurator provided)

    class fr.xgouchet.elmyr.junit5.ForgeExtension cannot access a member of class fr.xgouchet.elmyr.ForgeConfigurator$NoOp with modifiers "private"
    java.lang.IllegalAccessException: class fr.xgouchet.elmyr.junit5.ForgeExtension cannot access a member of class fr.xgouchet.elmyr.ForgeConfigurator$NoOp with modifiers "private"
    	at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:361)
    	at java.base/jdk.internal.reflect.Reflection.ensureMemberAccess(Reflection.java:99)
    	at java.base/java.lang.Class.newInstance(Class.java:579)
    	at fr.xgouchet.elmyr.junit5.ForgeExtension.getConfigurators(ForgeExtension.kt:193)
    	at fr.xgouchet.elmyr.junit5.ForgeExtension.beforeAll(ForgeExtension.kt:66)
    	at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeBeforeAllCallbacks$7(ClassBasedTestDescriptor.java:359)
    	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
    	at 
    [...]
    

    Here is my very basic test class:

    import fr.xgouchet.elmyr.annotation.IntForgery
    import fr.xgouchet.elmyr.junit5.ForgeConfiguration
    import fr.xgouchet.elmyr.junit5.ForgeExtension
    import io.kotest.matchers.shouldBe
    import org.junit.jupiter.api.Test
    import org.junit.jupiter.api.extension.ExtendWith
    
    @ExtendWith(ForgeExtension::class)
    @ForgeConfiguration(seed = 0x2af7b7def4L)
    class FooTest {
        @Test
        fun testSomething(@IntForgery i: Int) {
            i % 2 shouldBe 0
        }
    }
    

    version: 1.2.0 kotlin: 1.4.20 junit: 5.6.0

    bug 
    opened by vincent314 3
  • Alphanumerical characters contain

    Alphanumerical characters contain "_"

    ALPHA_NUM_UPPER and ALPHA_NUM_LOWER should not contain the _ character. I see that they are used when generating a character with anAlphaNumericalChar method.

    Also, is there an easier way to generate an alphanumerical String of fixed case and length?

    bug 
    opened by JDFind 3
  • Bump com.github.ben-manes.versions from 0.24.0 to 0.25.0

    Bump com.github.ben-manes.versions from 0.24.0 to 0.25.0

    Bumps com.github.ben-manes.versions from 0.24.0 to 0.25.0.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)

    Finally, you can contact us by mentioning @dependabot.

    dependencies 
    opened by dependabot-preview[bot] 2
  • Bump com.github.ben-manes.versions from 0.22.0 to 0.23.0

    Bump com.github.ben-manes.versions from 0.22.0 to 0.23.0

    Bumps com.github.ben-manes.versions from 0.22.0 to 0.23.0.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)

    Finally, you can contact us by mentioning @dependabot.

    dependencies 
    opened by dependabot-preview[bot] 2
  • Bump junit_platform_version from 1.0.0 to 1.2.0

    Bump junit_platform_version from 1.0.0 to 1.2.0

    Bumps junit_platform_version from 1.0.0 to 1.2.0.

    Updates junit-platform-gradle-plugin from 1.0.0 to 1.2.0

    Commits

    Updates junit-platform-launcher from 1.0.0 to 1.2.0

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Note: This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

    You can always request more updates by clicking Bump now in your Dependabot dashboard.

    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)

    Finally, you can contact us by mentioning @dependabot.

    dependencies 
    opened by dependabot-preview[bot] 2
  • Bump kotlin_version from 1.3.0 to 1.3.41

    Bump kotlin_version from 1.3.0 to 1.3.41

    Bumps kotlin_version from 1.3.0 to 1.3.41.

    Updates kotlin-stdlib from 1.3.0 to 1.3.41

    Release notes

    Sourced from kotlin-stdlib's releases.

    1.3.41

    Compiler

    • KT-31981 New type inference asks to use ?. on non-null local variable
    • KT-32029 Exception when callable reference is resolved against unresolved type
    • KT-32037 No coercion to Unit for last expression with lambda in code block
    • KT-32038 Unsubstituted stub type cause type mismatch later for builder inference
    • KT-32051 NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER on matching Nothing with generic type parameter
    • KT-32081 New type inference fails involving Either and Nothing
    • KT-32089 False positive IMPLICIT_NOTHING_AS_TYPE_PARAMETER with lambdas
    • KT-32094 NI: member from star import has higher resolution priority than member imported by FQN
    • KT-32116 Type inference for HashMap<,> fails but compiles
    • KT-32123 Wrong unused import for extension method
    • KT-32133 Regression in Kotlin 1.3.40 new inference engine
    • KT-32134 java.lang.Throwable: Resolution error of this type shouldn't occur for resolve try as a call for incomplete try-construction
    • KT-32143 1.3.40 new inference: backward incompatibility in method calls with multiple SAM arguments
    • KT-32154 setOf(Map.Entry<*, *>::key) gives error on IDE
    • KT-32157 Issue with new type inference in unbounded generics
    • KT-32175 New Type Inference Algorithm, RxJava and IDE-Compiler Inconsistency
    • KT-32184 NI: Argument for @​NotNull parameter 'type' of org/jetbrains/kotlin/types/CommonSupertypes.depth must not be null
    • KT-32187 Exception when using callable reference with an unresolved LHS
    • KT-32218 Cannot call get on a Map<out Any,Any> with new type system
    • KT-32230 New inference not working with RxJava combineLatest
    • KT-32235 New type inference failure with in check

    JavaScript

    • KT-32215 Reified generic doesn't work with ByteArray on js

    Tools. CLI

    • KT-32272 kotlinc - no main manifest attribute, in hello.jar

    Tools. REPL

    • KT-32085 Kotlinc REPL: "java.lang.NoClassDefFoundError: org/jline/reader/LineReaderBuilder"

    Tools. Scripts

    • KT-32169 Kotlin 1.3.40 - Crash on running *.main.kts script: "NoSuchMethodError: kotlin.script.templates.standard.ScriptTemplateWithArgs."
    • KT-32206 Custom script definitions not loaded in the cli compiler

    Previous releases

    This release also includes the fixes and improvements from the previous releases.

    Kotlin 1.3.40 EAP 3

    CHANGELOG

    1.3.40

    ... (truncated)
    Changelog

    Sourced from kotlin-stdlib's changelog.

    1.3.41

    Compiler

    • KT-31981 New type inference asks to use ?. on non-null local variable
    • KT-32029 Exception when callable reference is resolved against unresolved type
    • KT-32037 No coercion to Unit for last expression with lambda in code block
    • KT-32038 Unsubstituted stub type cause type mismatch later for builder inference
    • KT-32051 NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER on matching Nothing with generic type parameter
    • KT-32081 New type inference fails involving Either and Nothing
    • KT-32089 False positive IMPLICIT_NOTHING_AS_TYPE_PARAMETER with lambdas
    • KT-32094 NI: member from star import has higher resolution priority than member imported by FQN
    • KT-32116 Type inference for HashMap<,> fails but compiles
    • KT-32123 Wrong unused import for extension method
    • KT-32133 Regression in Kotlin 1.3.40 new inference engine
    • KT-32134 java.lang.Throwable: Resolution error of this type shouldn't occur for resolve try as a call for incomplete try-construction
    • KT-32143 1.3.40 new inference: backward incompatibility in method calls with multiple SAM arguments
    • KT-32154 setOf(Map.Entry<*, *>::key) gives error on IDE
    • KT-32157 Issue with new type inference in unbounded generics
    • KT-32175 New Type Inference Algorithm, RxJava and IDE-Compiler Inconsistency
    • KT-32184 NI: Argument for @​NotNull parameter 'type' of org/jetbrains/kotlin/types/CommonSupertypes.depth must not be null
    • KT-32187 Exception when using callable reference with an unresolved LHS
    • KT-32218 Cannot call get on a Map<out Any,Any> with new type system
    • KT-32230 New inference not working with RxJava combineLatest
    • KT-32235 New type inference failure with in check

    JavaScript

    • KT-32215 Reified generic doesn't work with ByteArray on js

    Tools. CLI

    • KT-32272 kotlinc - no main manifest attribute, in hello.jar

    Tools. REPL

    • KT-32085 Kotlinc REPL: "java.lang.NoClassDefFoundError: org/jline/reader/LineReaderBuilder"

    Tools. Scripts

    • KT-32169 Kotlin 1.3.40 - Crash on running *.main.kts script: "NoSuchMethodError: kotlin.script.templates.standard.ScriptTemplateWithArgs."
    • KT-32206 Custom script definitions not loaded in the cli compiler

    1.3.40

    Android

    Fixes

    • KT-12402 Android DataBinding work correctly but the IDE show it as error
    ... (truncated)
    Commits
    • c5a276c Update Kotlin/Native version
    • 1ad91cd Add changelog for 1.3.41
    • 791f49d Update Kotlin/Native version for testing
    • 270219d Fix filling Main-Class attribute in manifest file of output jar
    • ffc4096 Export deserialization constructor from JS module
    • fa9edf0 [NI] Fix exception on incomplete try/catch block
    • 9820481 [NI] Fix OnlyInputTypes annotation support for top-level captured types
    • bf6b58d [NI] Move ability to convert standalone SAM-argument under the feature
    • ba192c3 Gradle, JS: don't project.getTasksByName inside task realization callback
    • 5605a70 JS: fix reified T::class for primitive T (e.g. Int) (KT-32215 fixed)
    • Additional commits viewable in compare view

    Updates kotlin-reflect from 1.3.0 to 1.3.41

    Release notes

    Sourced from kotlin-reflect's releases.

    1.3.41

    Compiler

    • KT-31981 New type inference asks to use ?. on non-null local variable
    • KT-32029 Exception when callable reference is resolved against unresolved type
    • KT-32037 No coercion to Unit for last expression with lambda in code block
    • KT-32038 Unsubstituted stub type cause type mismatch later for builder inference
    • KT-32051 NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER on matching Nothing with generic type parameter
    • KT-32081 New type inference fails involving Either and Nothing
    • KT-32089 False positive IMPLICIT_NOTHING_AS_TYPE_PARAMETER with lambdas
    • KT-32094 NI: member from star import has higher resolution priority than member imported by FQN
    • KT-32116 Type inference for HashMap<,> fails but compiles
    • KT-32123 Wrong unused import for extension method
    • KT-32133 Regression in Kotlin 1.3.40 new inference engine
    • KT-32134 java.lang.Throwable: Resolution error of this type shouldn't occur for resolve try as a call for incomplete try-construction
    • KT-32143 1.3.40 new inference: backward incompatibility in method calls with multiple SAM arguments
    • KT-32154 setOf(Map.Entry<*, *>::key) gives error on IDE
    • KT-32157 Issue with new type inference in unbounded generics
    • KT-32175 New Type Inference Algorithm, RxJava and IDE-Compiler Inconsistency
    • KT-32184 NI: Argument for @​NotNull parameter 'type' of org/jetbrains/kotlin/types/CommonSupertypes.depth must not be null
    • KT-32187 Exception when using callable reference with an unresolved LHS
    • KT-32218 Cannot call get on a Map<out Any,Any> with new type system
    • KT-32230 New inference not working with RxJava combineLatest
    • KT-32235 New type inference failure with in check

    JavaScript

    • KT-32215 Reified generic doesn't work with ByteArray on js

    Tools. CLI

    • KT-32272 kotlinc - no main manifest attribute, in hello.jar

    Tools. REPL

    • KT-32085 Kotlinc REPL: "java.lang.NoClassDefFoundError: org/jline/reader/LineReaderBuilder"

    Tools. Scripts

    • KT-32169 Kotlin 1.3.40 - Crash on running *.main.kts script: "NoSuchMethodError: kotlin.script.templates.standard.ScriptTemplateWithArgs."
    • KT-32206 Custom script definitions not loaded in the cli compiler

    Previous releases

    This release also includes the fixes and improvements from the previous releases.

    Kotlin 1.3.40 EAP 3

    CHANGELOG

    1.3.40

    ... (truncated)
    Changelog

    Sourced from kotlin-reflect's changelog.

    1.3.41

    Compiler

    • KT-31981 New type inference asks to use ?. on non-null local variable
    • KT-32029 Exception when callable reference is resolved against unresolved type
    • KT-32037 No coercion to Unit for last expression with lambda in code block
    • KT-32038 Unsubstituted stub type cause type mismatch later for builder inference
    • KT-32051 NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER on matching Nothing with generic type parameter
    • KT-32081 New type inference fails involving Either and Nothing
    • KT-32089 False positive IMPLICIT_NOTHING_AS_TYPE_PARAMETER with lambdas
    • KT-32094 NI: member from star import has higher resolution priority than member imported by FQN
    • KT-32116 Type inference for HashMap<,> fails but compiles
    • KT-32123 Wrong unused import for extension method
    • KT-32133 Regression in Kotlin 1.3.40 new inference engine
    • KT-32134 java.lang.Throwable: Resolution error of this type shouldn't occur for resolve try as a call for incomplete try-construction
    • KT-32143 1.3.40 new inference: backward incompatibility in method calls with multiple SAM arguments
    • KT-32154 setOf(Map.Entry<*, *>::key) gives error on IDE
    • KT-32157 Issue with new type inference in unbounded generics
    • KT-32175 New Type Inference Algorithm, RxJava and IDE-Compiler Inconsistency
    • KT-32184 NI: Argument for @​NotNull parameter 'type' of org/jetbrains/kotlin/types/CommonSupertypes.depth must not be null
    • KT-32187 Exception when using callable reference with an unresolved LHS
    • KT-32218 Cannot call get on a Map<out Any,Any> with new type system
    • KT-32230 New inference not working with RxJava combineLatest
    • KT-32235 New type inference failure with in check

    JavaScript

    • KT-32215 Reified generic doesn't work with ByteArray on js

    Tools. CLI

    • KT-32272 kotlinc - no main manifest attribute, in hello.jar

    Tools. REPL

    • KT-32085 Kotlinc REPL: "java.lang.NoClassDefFoundError: org/jline/reader/LineReaderBuilder"

    Tools. Scripts

    • KT-32169 Kotlin 1.3.40 - Crash on running *.main.kts script: "NoSuchMethodError: kotlin.script.templates.standard.ScriptTemplateWithArgs."
    • KT-32206 Custom script definitions not loaded in the cli compiler

    1.3.40

    Android

    Fixes

    • KT-12402 Android DataBinding work correctly but the IDE show it as error
    ... (truncated)
    Commits
    • c5a276c Update Kotlin/Native version
    • 1ad91cd Add changelog for 1.3.41
    • 791f49d Update Kotlin/Native version for testing
    • 270219d Fix filling Main-Class attribute in manifest file of output jar
    • ffc4096 Export deserialization constructor from JS module
    • fa9edf0 [NI] Fix exception on incomplete try/catch block
    • 9820481 [NI] Fix OnlyInputTypes annotation support for top-level captured types
    • bf6b58d [NI] Move ability to convert standalone SAM-argument under the feature
    • ba192c3 Gradle, JS: don't project.getTasksByName inside task realization callback
    • 5605a70 JS: fix reified T::class for primitive T (e.g. Int) (KT-32215 fixed)
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Note: This repo was added to Dependabot recently, so you'll receive a maximum of 5 PRs for your first few update runs. Once an update run creates fewer than 5 PRs we'll remove that limit.

    You can always request more updates by clicking Bump now in your Dependabot dashboard.

    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)

    Finally, you can contact us by mentioning @dependabot.

    dependencies 
    opened by dependabot-preview[bot] 2
  • Seems like the hosting server of Elmyr library has been shutdown

    Seems like the hosting server of Elmyr library has been shutdown

    Seems like this library was using https://status.bintray.com/ which has been shutdown/ Is there any way to host the library in a different place?

    In order to reproduce this issue you can check this link: https://google.bintray.com/flexbox-layout/com/github/xgouchet/Elmyr/1.3.0/Elmyr-1.3.0.pom It is returning a 502 error

    opened by carlosmacieljrpe 1
  • Bump junit-vintage-engine from 5.5.1 to 5.5.2

    Bump junit-vintage-engine from 5.5.1 to 5.5.2

    Bumps junit-vintage-engine from 5.5.1 to 5.5.2.

    Release notes

    Sourced from junit-vintage-engine's releases.

    JUnit 5.5.2 = Platform 1.5.2 + Jupiter 5.5.2 + Vintage 5.5.2

    See Release Notes.

    Commits
    • 3892622 Release 5.5.2
    • edd36d7 Log cause for failure to load AssumptionViolatedException
    • cc13950 Update @​since tag
    • a962909 Document #2003 in the 5.5.2 Release Notes
    • 835d800 Avoid JupiterTestEngine crash if Hamcrest is not on the classpath
    • e9baa52 Correct file type of module descriptors included in JAR files
    • 83bf310 Introduce release notes for 5.5.2
    • edcba1c Back to snapshots for further development
    • See full diff in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)

    Finally, you can contact us by mentioning @dependabot.

    dependencies 
    opened by dependabot-preview[bot] 1
  • Bump com.github.ben-manes.versions from 0.22.0 to 0.24.0

    Bump com.github.ben-manes.versions from 0.22.0 to 0.24.0

    Bumps com.github.ben-manes.versions from 0.22.0 to 0.24.0.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)

    Finally, you can contact us by mentioning @dependabot.

    dependencies 
    opened by dependabot-preview[bot] 1
  • Generate url that matches Patterns.WEB_URL

    Generate url that matches Patterns.WEB_URL

    Hi! Is it possible to generate url which matches Patterns.WEB_URL from Android?

     /**
         *  Regular expression pattern to match most part of RFC 3987
         *  Internationalized URLs, aka IRIs.
         */
        public static final Pattern WEB_URL = Pattern.compile("("
                + "("
                + "(?:" + PROTOCOL + "(?:" + USER_INFO + ")?" + ")?"
                + "(?:" + DOMAIN_NAME_STR + ")"
                + "(?:" + PORT_NUMBER + ")?"
                + ")"
                + "(" + PATH_AND_QUERY + ")?"
                + WORD_BOUNDARY
                + ")");
    

    Forger.aUrl(scheme = "http") does not follow that standard.

    enhancement 
    opened by rafal-kobylko 1
  • Bump io.gitlab.arturbosch.detekt from 1.0.0.RC8 to 1.0.1

    Bump io.gitlab.arturbosch.detekt from 1.0.0.RC8 to 1.0.1

    Bumps io.gitlab.arturbosch.detekt from 1.0.0.RC8 to 1.0.1.

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in your Dependabot dashboard:

    • Update frequency (including time of day and day of week)
    • Pull request limits (per update run and/or open at any time)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)

    Finally, you can contact us by mentioning @dependabot.

    dependencies 
    opened by dependabot-preview[bot] 1
  • Issue with Java 11

    Issue with Java 11

    Since upgrading to 1.3.2, I have the following compile issue when testing : Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option

    Could the libs be built with Java 8 ?

    opened by bishiboosh 0
  • Add support for Character Class Intersection in Regex forgery

    Add support for Character Class Intersection in Regex forgery

    Right now we do not support Character Class Intersection:

    • /[a-m&&[g-x]]/ should have the same results as /[g-m]/
    • /[a-m&&g-x]/ should have the same results as /[g-m]/
    • /[a-m&&[^c-g]]/ should have the same results as /[a-bh-m]/
    • /[a-z&&[aeiou&&[^c-g]]]/ should have the same results as /[aiou]/
    enhancement Hacktoberfest 
    opened by xgouchet 0
Releases(1.3.4)
  • 1.3.3(May 5, 2022)

  • 1.3.2(May 5, 2022)

    core

    • Add the Forge.shuffle(String): String and Forge.shuffle(Array<T>): Array<T> methods

    semantics

    • Add the semantics library providing some human readable fake Strings generation (names, lipsum, …)
    Source code(tar.gz)
    Source code(zip)
  • 1.3.1(Sep 7, 2021)

    Changelog

    core

    • Fix some invalid regex forgeries (e.g.: "[^a-z]+" was not handled properly)

    junit5

    • Fix an error when a ForgeConfiguration was missing a ForgeConfigurator
    Source code(tar.gz)
    Source code(zip)
  • 1.3.0(Apr 14, 2021)

     repositories {
            maven { url "https://jitpack.io" }
        }
        dependencies {
            testCompile("com.github.xgouchet.Elmyr:core:1.3.0")
    
            // Artifacts to integrate Elmyr with your favorite Test Framework
            testCompile("com.github.xgouchet.Elmyr:junit4:1.3.0")
            testCompile("com.github.xgouchet.Elmyr:junit5:1.3.0")
            testCompile("com.github.xgouchet.Elmyr:spek:1.3.0")
    
            // add support for JVM classes forgeries (Date, Locale, …)
            testCompile("com.github.xgouchet.Elmyr:jvm:1.3.0")
        }
    

    Changelog

    inject

    • Add a listener to the ForgeryInjector to be notified when an injection happens
    • Allow advanced forgery injections using @PairForgery

    junit4

    • Make the error message more verbose

    junit5

    • Make the error message more verbose
    • Allow advanced forgery injections using @PairForgery
    • Add the forge to the global extension context store (use the ForgeExtension.getForge(ExtensionContext) method to retrieve it)
    Source code(tar.gz)
    Source code(zip)
  • 1.2.0(Sep 3, 2020)

     repositories {
            maven { url "https://jitpack.io" }
        }
        dependencies {
            testCompile("com.github.xgouchet.Elmyr:core:1.1.0")
    
            // Artifacts to integrate Elmyr with your favorite Test Framework
            testCompile("com.github.xgouchet.Elmyr:junit4:1.1.0")
            testCompile("com.github.xgouchet.Elmyr:junit5:1.1.0")
            testCompile("com.github.xgouchet.Elmyr:spek:1.1.0")
    
            // add support for JVM classes forgeries (Date, Locale, …)
            testCompile("com.github.xgouchet.Elmyr:jvm:1.1.0")
        }
    

    Changelog

    core

    • Allow using the @StringForgery annotation to forge Strings based on Regex
    • Allow setting a size in @StringForgery annotation

    inject

    • Allow injecting collections of primitives with @BoolForgery, @IntForgery, @LongForgery, @FloatForgery, @DoubleForgery, as well as @StringForgery and RegexForgery
    • Allow advanced forgery injections using @AdvancedForgery and @MapForgery

    junit5

    • Allow injecting collections of primitives with @BoolForgery, @IntForgery, @LongForgery, @FloatForgery, @DoubleForgery, as well as @StringForgery and RegexForgery
    • Allow advanced forgery injections using @AdvancedForgery and @MapForgery
    Source code(tar.gz)
    Source code(zip)
  • 1.1.0(Aug 24, 2020)

     repositories {
            maven { url "https://jitpack.io" }
        }
        dependencies {
            testCompile("com.github.xgouchet.Elmyr:core:1.1.0")
    
            // Artifacts to integrate Elmyr with your favorite Test Framework
            testCompile("com.github.xgouchet.Elmyr:junit4:1.1.0")
            testCompile("com.github.xgouchet.Elmyr:junit5:1.1.0")
            testCompile("com.github.xgouchet.Elmyr:spek:1.1.0")
    
            // add support for JVM classes forgeries (Date, Locale, …)
            testCompile("com.github.xgouchet.Elmyr:jvm:1.1.0")
        }
    

    Changelog

    core

    • Fix float and double forgeries (they sometimes returned values out of the requested range)

    inject

    • Add default String type (i.e.: ALPHABETICAL) to the @StringForgery annotation

    spek

    • Implement a spekForge helper method to add reproducibility in Spek tests
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0(Feb 17, 2020)

        repositories {
            maven { url "https://jitpack.io" }
        }
        dependencies {
            testCompile("com.github.xgouchet.Elmyr:core:1.0.0")
            testCompile("com.github.xgouchet.Elmyr:junit4:1.0.0")
            testCompile("com.github.xgouchet.Elmyr:junit5:1.0.0")
            testCompile("com.github.xgouchet.Elmyr:jvm:1.0.0")
        }```
    Source code(tar.gz)
    Source code(zip)
  • 1.0.0-beta3(Feb 17, 2020)

  • 1.0.0-beta2(Feb 17, 2020)

  • 1.0.0-beta1(Feb 17, 2020)

Owner
Xavier F. Gouchet
Senior Software Engineer @datadoghq, professional speaker and erstwhile teacher. Music addict, irredeemably curious and adept of pogonotomy 🏳️‍🌈
Xavier F. Gouchet
YASNAC (short for Yet Another SafetyNet Attestation Checker) is an Android app that demonstrates SafetyNet Attestation API.

YASNAC YASNAC (short for Yet Another SafetyNet Attestation Checker) is an Android app that demonstrates SafetyNet Attestation API. YASNAC is written w

Rikka 361 Dec 31, 2022
Automated tests using Rest-assured with Kotlin lang

Testes de API em Kotlin Pré-requisitos Instalar o Kotlin Ambiente Para executar os testes localmente, estou utilizando o ServeRest Link do Repo: https

Rafael Berçam 15 Dec 23, 2022
3 types of Tests in Android (Unit - instrumentation - UI)

UnitTestingPractice 3 types of Tests in Android Unit instrumentation (Integration) UI Unit Testing benefits confirm code work like a charm simulate Ap

Ahmed Tawfiq 8 Mar 23, 2022
Raccoon is a lightweight response mocking framework that can be easily integrated into the Android UI tests.

Raccoon Medium Articles Checkout these article to get more insights about this library: How to integrate this in your Android Test Why Raccoon? There

Joseph James 52 Aug 15, 2022
Easily scale your Android Instrumentation Tests across Firebase Test Lab with Flank.

Easily scale your Android Instrumentation Tests across Firebase Test Lab with Flank.

Nelson Osacky 220 Nov 29, 2022
Using grpc-wiremock to mock responses in integrated tests of gRPC services

Utilizando grpc-wiremock para mockar respostas em testes integrados de serviços gRPC Este repositório possui um exemplo prático de como configurar e r

Tony A. Luz 2 Oct 28, 2021
A library that makes it easier to write high quality automated acceptance tests

Getting started with Serenity and Cucumber Serenity BDD is a library that makes it easier to write high quality automated acceptance tests, with power

ricardo larrahondo 1 Oct 20, 2021
A simple project to help developers in writing their unit tests in Android Platform.

AndroidUnitTesting A simple project to help developers in writing their unit tests in Android Platform. This is not a multi-module project, but has th

Bruno Gabriel dos Santos 4 Nov 10, 2021
A JUnit5 Platform TestEngine integrated with the official FHIR Validator to run profile and Questionnaire validation as tests.

?? FHIR Validator JUnit Engine A JUnit5 TestEngine to integrate the FHIR Validator into the JUnit5 ecosystem. Supports writing expected validation out

NAV IT 2 Feb 2, 2022
Espresso - Use Espresso to write concise, beautiful, and reliable Android UI tests

Espresso Use Espresso to write concise, beautiful, and reliable Android UI tests

Android For All 1 Jan 26, 2022
Write Tests as Examples on the Method-under-test

Write Tests as Examples on the Method-under-test

Paul Methfessel 1 Apr 12, 2022
A collection of tests and easy to reuse pieces of code for bdk-jvm and bdk-android

Readme This repo is a collection of tests and easy to reuse pieces of code for bdk-jvm and bdk-android. Note that they don't aim to provide a full cov

thunderbiscuit 1 Jun 28, 2022
TestObserver to easily test LiveData and make assertions on them.

JCenter Update LiveData Testing is currently published on JCenter - it will serve packages until February 1st, 2022. LiveData Testing packages will be

Josef Raska 395 Dec 8, 2022
Selenium locators for Java/Kotlin that resemble the Testing Library (testing-library.com).

Selenium Testing Library Testing Library selectors available as Selenium locators for Kotlin/Java. Why? When I use Selenium, I don't want to depend on

Luís Soares 5 Dec 15, 2022
A programmer-oriented testing framework for Java.

JUnit 4 JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks. For more infor

JUnit 8.4k Jan 9, 2023
PowerMock is a Java framework that allows you to unit test code normally regarded as untestable.

Writing unit tests can be hard and sometimes good design has to be sacrificed for the sole purpose of testability. Often testability corresponds to go

PowerMock 3.9k Jan 5, 2023
A programmer-oriented testing framework for Java.

JUnit 4 JUnit is a simple framework to write repeatable tests. It is an instance of the xUnit architecture for unit testing frameworks. For more infor

JUnit 8.4k Dec 28, 2022
PowerMock is a Java framework that allows you to unit test code normally regarded as untestable.

Writing unit tests can be hard and sometimes good design has to be sacrificed for the sole purpose of testability. Often testability corresponds to go

PowerMock 3.9k Jan 2, 2023
Kotlin wrapper for React Test Renderer, which can be used to unit test React components in a Kotlin/JS project.

Kotlin API for React Test Renderer Kotlin wrapper for React Test Renderer, which can be used to unit test React components in a Kotlin/JS project. How

Xavier Cho 7 Jun 8, 2022