Skip to content

Commit e1ad2cd

Browse files
committed
Fix Windows build failures
See gh-23098
1 parent a48c98b commit e1ad2cd

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/availability/ApplicationAvailabilityBeanTests.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,23 +96,25 @@ void getLastChangeEventWhenEventHasBeenPublishedReturnsPublishedState() {
9696
@Test
9797
void stateChangesAreLogged(CapturedOutput output) {
9898
AvailabilityChangeEvent.publish(this.context, LivenessState.CORRECT);
99-
assertThat(output).contains("Application availability state LivenessState changed to CORRECT\n");
99+
assertThat(output)
100+
.contains("Application availability state LivenessState changed to CORRECT" + System.lineSeparator());
100101
AvailabilityChangeEvent.publish(this.context, LivenessState.BROKEN);
101-
assertThat(output).contains("Application availability state LivenessState changed from CORRECT to BROKEN\n");
102+
assertThat(output).contains(
103+
"Application availability state LivenessState changed from CORRECT to BROKEN" + System.lineSeparator());
102104
}
103105

104106
@Test
105107
void stateChangesAreLoggedWithExceptionSource(CapturedOutput output) {
106108
AvailabilityChangeEvent.publish(this.context, new IOException("connection error"), LivenessState.BROKEN);
107109
assertThat(output).contains("Application availability state LivenessState changed to BROKEN: "
108-
+ "java.io.IOException: connection error\n");
110+
+ "java.io.IOException: connection error" + System.lineSeparator());
109111
}
110112

111113
@Test
112114
void stateChangesAreLoggedWithOtherSource(CapturedOutput output) {
113115
AvailabilityChangeEvent.publish(this.context, new CustomEventSource(), LivenessState.BROKEN);
114116
assertThat(output).contains("Application availability state LivenessState changed to BROKEN: "
115-
+ CustomEventSource.class.getName() + "\n");
117+
+ CustomEventSource.class.getName() + System.lineSeparator());
116118
}
117119

118120
enum TestState implements AvailabilityState {

0 commit comments

Comments
 (0)