All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.http4k.testing.TestNamer.kt Maven / Gradle / Ivy

There is a newer version: 5.35.1.0
Show newest version
package org.http4k.testing

import java.lang.reflect.Method

/**
 * Provides the identification of test case.
 */
fun interface TestNamer {
    fun nameFor(testClass: Class<*>, testMethod: Method): String

    companion object {
        val ClassAndMethod = TestNamer { testClass, testMethod ->
            testClass.`package`.name.replace('.', '/') + '/' + testClass.simpleName + "." + testMethod.name
        }

        val ClassDirAndMethod = TestNamer { testClass, testMethod ->
            testClass.`package`.name.replace('.', '/') + '/' + testClass.simpleName + "/" + testMethod.name
        }

        val MethodOnly = TestNamer { testClass, testMethod ->
            testClass.`package`.name.replace('.', '/') + '/' + testMethod.name
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy