Skip to content

Commit 3cb0ee0

Browse files
author
yevhenii-nadtochii
committed
Shorten the list of required dependencies
1 parent e1fe3dc commit 3cb0ee0

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

java-ksp/src/test/kotlin/io/spine/validation/java/ksp/ValidatorCompilationTest.kt

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,15 @@
2727
package io.spine.validation.java.ksp
2828

2929
import com.google.protobuf.Message
30-
import com.google.protobuf.Timestamp
3130
import com.intellij.util.lang.JavaVersion
3231
import com.tschuchort.compiletesting.JvmCompilationResult
3332
import com.tschuchort.compiletesting.KotlinCompilation
3433
import com.tschuchort.compiletesting.SourceFile
35-
import com.tschuchort.compiletesting.SourceFile.Companion.java
3634
import com.tschuchort.compiletesting.SourceFile.Companion.kotlin
3735
import com.tschuchort.compiletesting.configureKsp
3836
import io.spine.logging.testing.ConsoleTap
3937
import io.spine.logging.testing.tapConsole
4038
import io.spine.validation.api.Validator
41-
import io.spine.validation.api.MessageValidator
4239
import java.io.File
4340
import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
4441
import org.junit.jupiter.api.BeforeAll
@@ -71,13 +68,9 @@ internal sealed class ValidatorCompilationTest {
7168
@BeforeEach
7269
fun prepareCompilation() {
7370
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.
7772
Message::class.java, // Protobuf.
78-
ValidatorProcessorProvider::class.java, // The test subject.
7973
).map { it.classpathFile() }
80-
8174
compilation = KotlinCompilation()
8275
compilation.apply {
8376
jvmTarget = JavaVersion.current().toFeatureString()
@@ -116,16 +109,6 @@ private fun Class<*>.classpathFile(): File = File(protectionDomain.codeSource.lo
116109
*/
117110
private const val PACKAGE_DIR = "io/spine/validation/java/ksp/test"
118111

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-
129112
/**
130113
* Creates an instance of [SourceFile] with the Kotlin file containing the class
131114
* with the specified name and contents.

0 commit comments

Comments
 (0)