Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 1.5 KB

README.md

File metadata and controls

51 lines (33 loc) · 1.5 KB

Build Status License Sonatype Nexus (Snapshots)

Mock Auth Server

Integrate a mock auth server within your Kotlin application to issue tokens for development and testing purpose.

Include library

Currently only SNAPSHOTS are available at the sonatype snapshot repository. Add the following to your buidl.gradle.kts.

repositories {
    maven {
        url = uri("https://oss.sonatype.org/content/repositories/snapshots")
    }
}

dependencies {
    implementation("cloud.rio:mock-auth-server:0.2.0-SNAPSHOT")
}

Usage

Within a (integration) test that requires a token

import cloud.rio.iam.auth.MockAuthServer

fun test() {

    MockAuthServer().use {
        val port = it.start()
        
        // do request a token on the random selected port on localhost   
        
        // do some code/tests with the token
        
        // server is closed automatically after the use-block 
    }

}

License

Mock Auth Server is licensed under the Apache 2.0 license.