com.wesleyhome.test.jupiter.provider.datetime.LocalDateValueSourceDataProvider.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of junit-jupiter-params-generated Show documentation
Show all versions of junit-jupiter-params-generated Show documentation
Library to help generate test parameter permutations for parameterized tests in JUnit.
This version is an initial attempt to convert to building with Gradle.
The newest version!
package com.wesleyhome.test.jupiter.provider.datetime
import com.wesleyhome.test.jupiter.annotations.datetime.LocalDateSource
import com.wesleyhome.test.jupiter.provider.AbstractAnnotatedParameterDataProvider
import com.wesleyhome.test.jupiter.provider.TestParameter
import com.wesleyhome.test.jupiter.toLocalDate
import java.time.LocalDate
internal class LocalDateValueSourceDataProvider : AbstractAnnotatedParameterDataProvider() {
override fun createParameterOptionsData(testParameter: TestParameter): List {
val localDateSource = findAnnotation(testParameter)!!
return localDateSource.values
.map { it.toLocalDate(localDateSource.dateFormat) }
.toList()
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy