org.http4k.testing.TestNamer.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of http4k-testing-approval Show documentation
Show all versions of http4k-testing-approval Show documentation
Http4k support for Approval Testing
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
}
}
}