Skip to content

Commit

Permalink
Added Test for AddSpringPropertyIfClassExists
Browse files Browse the repository at this point in the history
  • Loading branch information
JohannesRabauer committed Feb 9, 2024
1 parent da2121d commit 34d62b0
Showing 1 changed file with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down

0 comments on commit 34d62b0

Please sign in to comment.