Skip to content

Commit

Permalink
启用kotlin单元测试.
Browse files Browse the repository at this point in the history
  • Loading branch information
nieqiurong committed Feb 24, 2025
1 parent 72b880c commit ecd4679
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ abstract class BaseDbTest<T> : TypeReference<T>() {
protected var jdbcTemplate: JdbcTemplate

init {
SqlRunner.DEFAULT.close()
val ds = dataSource()
val tableSql = tableSql()
val tableDataSql = tableDataSql()
Expand Down
13 changes: 13 additions & 0 deletions mybatis-plus/build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
apply plugin: 'kotlin'

compileKotlin{
kotlinOptions.jvmTarget = "1.8"
}

compileTestKotlin {
kotlinOptions {
freeCompilerArgs = ['-Xjvm-default=all']
}
}

dependencies {
api project(":mybatis-plus-core")
api project(":mybatis-plus-annotation")
Expand All @@ -6,6 +18,7 @@ dependencies {
api "${lib.mybatis}"

implementation "${lib."mybatis-spring"}"
implementation "${lib."kotlin-stdlib-jdk8"}"

testImplementation "${lib.'spring-web'}"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ void test() throws IOException {
Dependency extension = dependenciesMap.get("mybatis-plus-spring");
Assertions.assertEquals("compile", extension.getScope());
Assertions.assertFalse(extension.isOptional());
Dependency mybatisSpring = dependenciesMap.get("mybatis-spring");
Assertions.assertEquals("compile", mybatisSpring.getScope());
Assertions.assertTrue(mybatisSpring.isOptional());
Dependency kotlinStdlib = dependenciesMap.get("kotlin-stdlib-jdk8");
Assertions.assertEquals("compile", kotlinStdlib.getScope());
Assertions.assertTrue(kotlinStdlib.isOptional());
}
}

Expand Down

0 comments on commit ecd4679

Please sign in to comment.