Skip to content

Commit

Permalink
rewrite 7.29.0 breaking changes update.
Browse files Browse the repository at this point in the history
  • Loading branch information
pway99 committed Aug 24, 2022
1 parent 07449ee commit abc0126
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SeparateApplicationYamlByProfileTest : YamlRecipeTest {
activate:
on-profile: test
name: test
""".trimIndent()).map { it.withSourcePath(Paths.get("src/main/resources/application.yml")) }).groupByProfile()
""".trimIndent()).map { it.withSourcePath(Paths.get("src/main/resources/application.yml")) }).results.groupByProfile()

assertThat(results["application.yml"]).isEqualTo("name: main")
assertThat(results["application-test.yml"]).isEqualTo("name: test")
Expand All @@ -51,7 +51,7 @@ class SeparateApplicationYamlByProfileTest : YamlRecipeTest {
activate:
on-profile: test
name: test
""".trimIndent()).map { it.withSourcePath(Paths.get("src/main/resources/application.yml")) }).groupByProfile()
""".trimIndent()).map { it.withSourcePath(Paths.get("src/main/resources/application.yml")) }).results.groupByProfile()

assertThat(results["application.yml"]).isEqualTo(null)
assertThat(results["application-test.yml"]).isEqualTo("name: test")
Expand All @@ -65,7 +65,7 @@ class SeparateApplicationYamlByProfileTest : YamlRecipeTest {
activate:
on-profile: !test
name: test
""".trimIndent())).isEmpty()
""".trimIndent())).results.isEmpty()
}

private fun List<Result>.groupByProfile() = associate { r ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class MergeBootstrapYamlWithApplicationYamlTest : YamlRecipeTest {
).map { it.withSourcePath(Paths.get("src/main/resources/bootstrap.yml")) }

val results = recipe.run(bootstrapYaml + applicationYaml)
.sortedBy { it.before!!.sourcePath.fileName.toString() }
.results.sortedBy { it.before!!.sourcePath.fileName.toString() }

assertThat(results).hasSize(2)
assertThat(results[1].after).isNull()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class UpdateApiManifestTest : JavaRecipeTest {

@Test
fun requestMappingWithMethod() {
val results = recipe.run(parser.parse("""
val recipeRun = recipe.run(parser.parse("""
import java.util.List;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
Expand All @@ -49,8 +49,8 @@ class UpdateApiManifestTest : JavaRecipeTest {
}
""".trimIndent()))

assertThat(results.size).isEqualTo(1)
assertThat(results[0].after!!.sourcePath).isEqualTo(Paths.get("META-INF/api-manifest.txt"))
assertThat(results[0].after!!.printAll()).isEqualTo("POST /users/post")
assertThat(recipeRun.results.size).isEqualTo(1)
assertThat(recipeRun.results[0].after!!.sourcePath).isEqualTo(Paths.get("META-INF/api-manifest.txt"))
assertThat(recipeRun.results[0].after!!.printAll()).isEqualTo("POST /users/post")
}
}

0 comments on commit abc0126

Please sign in to comment.