Merge branch '7.0.x'

This commit is contained in:
Brian Clozel
2026-06-03 11:23:03 +02:00
4 changed files with 64 additions and 7 deletions
@@ -22,6 +22,7 @@ import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
import org.junit.jupiter.params.provider.MethodSource;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException;
/**
@@ -44,6 +45,15 @@ class ServerSentEventTests {
ServerSentEvent.<String>builder().event("first" + newLine + "second").build());
}
@ParameterizedTest(name = "{1}")
@MethodSource("newLineCharacters")
void supportMultiLineComments(String newLine, String description) {
ServerSentEvent<String> event = ServerSentEvent.<String>builder()
.comment("foo" + newLine + "bar" + newLine + "baz").data("payload").build();
assertThat(event.format()).isEqualTo(":foo\n:bar\n:baz\ndata:");
}
private static Stream<Arguments> newLineCharacters() {
return Stream.of(
Arguments.of("\n", "LF"),