|
27 | 27 | package io.spine.validation.java.ksp
|
28 | 28 |
|
29 | 29 | import com.google.protobuf.Message
|
30 |
| -import com.google.protobuf.Timestamp |
31 | 30 | import com.intellij.util.lang.JavaVersion
|
32 | 31 | import com.tschuchort.compiletesting.JvmCompilationResult
|
33 | 32 | import com.tschuchort.compiletesting.KotlinCompilation
|
34 | 33 | import com.tschuchort.compiletesting.SourceFile
|
35 |
| -import com.tschuchort.compiletesting.SourceFile.Companion.java |
36 | 34 | import com.tschuchort.compiletesting.SourceFile.Companion.kotlin
|
37 | 35 | import com.tschuchort.compiletesting.configureKsp
|
38 | 36 | import io.spine.logging.testing.ConsoleTap
|
39 | 37 | import io.spine.logging.testing.tapConsole
|
40 | 38 | import io.spine.validation.api.Validator
|
41 |
| -import io.spine.validation.api.MessageValidator |
42 | 39 | import java.io.File
|
43 | 40 | import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
|
44 | 41 | import org.junit.jupiter.api.BeforeAll
|
@@ -71,13 +68,9 @@ internal sealed class ValidatorCompilationTest {
|
71 | 68 | @BeforeEach
|
72 | 69 | fun prepareCompilation() {
|
73 | 70 | val dependencyJars = setOf(
|
74 |
| - Validator::class.java, // The annotation. |
75 |
| - MessageValidator::class.java, // The validator interface. |
76 |
| - Timestamp::class.java, // The external message to use. |
| 71 | + Validator::class.java, // The annotation to discover. |
77 | 72 | Message::class.java, // Protobuf.
|
78 |
| - ValidatorProcessorProvider::class.java, // The test subject. |
79 | 73 | ).map { it.classpathFile() }
|
80 |
| - |
81 | 74 | compilation = KotlinCompilation()
|
82 | 75 | compilation.apply {
|
83 | 76 | jvmTarget = JavaVersion.current().toFeatureString()
|
@@ -116,16 +109,6 @@ private fun Class<*>.classpathFile(): File = File(protectionDomain.codeSource.lo
|
116 | 109 | */
|
117 | 110 | private const val PACKAGE_DIR = "io/spine/validation/java/ksp/test"
|
118 | 111 |
|
119 |
| -/** |
120 |
| - * Creates an instance of [SourceFile] with the Java file containing the class |
121 |
| - * with the specified name and contents. |
122 |
| - */ |
123 |
| -internal fun javaFile(simpleClassName: String, contents: String): SourceFile = java( |
124 |
| - name = "$PACKAGE_DIR/${simpleClassName}.java", |
125 |
| - contents = contents, |
126 |
| - trimIndent = true |
127 |
| -) |
128 |
| - |
129 | 112 | /**
|
130 | 113 | * Creates an instance of [SourceFile] with the Kotlin file containing the class
|
131 | 114 | * with the specified name and contents.
|
|
0 commit comments