Код: Выделить всё
class UpgradeNonSpringDependenciesTest : RewriteTest {
override fun defaultExecutionContext(sourceSpecs: Array): ExecutionContext {
val ctx: ExecutionContext = InMemoryExecutionContext { t: Throwable? -> AssertionsForClassTypes.fail("Failed to parse sources or run recipe", t) }
MavenExecutionContextView.view(ctx).setMavenSettings(MavenSettings.readMavenSettingsFromDisk(ctx))
return ctx
}
@Test
fun upgradeDependencies() = rewriteRun(
{ spec ->
spec.recipeFromResource("/META-INF/rewrite/my.yml", "net.me.recipe.maven.UpgradeNonSpringDependencies")
},
pomXml(
"""
4.0.0
com.example
example-artifact
1.0.0
com.me
kafka-core
1.0.1
""".trimIndent(),
"""
4.0.0
com.example
example-artifact
1.0.0
com.me
kafka-core
2.0.1
""".trimIndent()
) { spec -> spec.path("pom.xml") }
)
}
Код: Выделить всё
[ERROR] UpgradeNonSpringDependenciesTest.upgradeDependencies:21 [Unexpected result in "pom.xml":
diff --git a/pom.xml b/pom.xml
index 8c9f791..0e1d1c7 100644
--- a/pom.xml
+++ b/pom.xml
com.me
kafka-core
- 2.0.1
+ 2.0.2
Подробнее здесь: https://stackoverflow.com/questions/792 ... re-version
Мобильная версия