From 34d62b06e9e4dfad5ec2d1087de0c2070ab5da91 Mon Sep 17 00:00:00 2001 From: JohannesRabauer Date: Fri, 9 Feb 2024 14:35:59 +0100 Subject: [PATCH] Added Test for AddSpringPropertyIfClassExists --- .../AddSpringPropertyIfClassExistsTest.java | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/spring-data-eclipse-store-migration/src/test/java/software/xdev/spring/data/eclipse/store/AddSpringPropertyIfClassExistsTest.java b/spring-data-eclipse-store-migration/src/test/java/software/xdev/spring/data/eclipse/store/AddSpringPropertyIfClassExistsTest.java index b9f5d6d..58cbdb1 100644 --- a/spring-data-eclipse-store-migration/src/test/java/software/xdev/spring/data/eclipse/store/AddSpringPropertyIfClassExistsTest.java +++ b/spring-data-eclipse-store-migration/src/test/java/software/xdev/spring/data/eclipse/store/AddSpringPropertyIfClassExistsTest.java @@ -76,6 +76,45 @@ void testSimpleYaml() ); } + @Test + void testMultipleYamlAlsoInTestFolder() + { + this.rewriteRun + ( + yaml( + "", + """ + spring: + autoconfigure: + exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration + """, + s -> s.path("/src/main/resources/application.yml") + ), + yaml( + "", + """ + spring: + autoconfigure: + exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration + """, + s -> s.path("/src/test/resources/application.yml") + ), + yaml( + "", + """ + spring: + autoconfigure: + exclude: org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration,org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration + """, + s -> s.path("application.yml") + ), + yaml( + "", + s -> s.path("no-application.yml") + ) + ); + } + @Test void testWrongFileNameYaml() {