Refactor PartGenerator to use isLast

This commit refactors the PartGenerator to use the newly introduced
Token::isLast property.

See gh-28006
This commit is contained in:
Arjen Poutsma
2022-04-11 16:03:42 +02:00
parent d44ba0a42b
commit e29bc3db7c
3 changed files with 50 additions and 80 deletions

View File

@@ -118,6 +118,10 @@ class DefaultPartHttpMessageReaderTests {
Flux<Part> result = reader.read(forClass(Part.class), request, emptyMap());
StepVerifier.create(result)
.consumeNextWith(part -> {
assertThat(part.headers().getFirst("Header")).isEqualTo("Value");
part.content().subscribe(DataBufferUtils::release);
})
.expectError(DecodingException.class)
.verify();
}