Skip to content

Commit

Permalink
Rename ChangePropertyTest and document empty file newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
timtebeek committed Jun 9, 2023
1 parent fdced00 commit c45abbb
Showing 1 changed file with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import static org.openrewrite.properties.Assertions.properties;

@SuppressWarnings("UnusedProperty")
class ChangePropertyTest implements RewriteTest {
class AddPropertyTest implements RewriteTest {

@Test
void emptyProperty() {
Expand Down Expand Up @@ -135,4 +135,24 @@ void delimitedByWhitespace() {
)
);
}

@Test
void addToEmptyFile() {
rewriteRun(
spec -> spec.recipe(new AddProperty(
"management.metrics.enable.process.files",
"true",
null
)),
// document current behaviour or excess preceding newlines added to empty files; ought to be rare but still
properties(
"",
"""
management.metrics.enable.process.files=true
"""
)
);
}
}

0 comments on commit c45abbb

Please sign in to comment.