use of cn.taketoday.core.codec.CharSequenceEncoder in project today-infrastructure by TAKETODAY.
the class CancelWithoutDemandCodecTests method cancelWithEncoderHttpMessageWriterAndSingleValue.
// gh-22107
@Test
public void cancelWithEncoderHttpMessageWriterAndSingleValue() {
CharSequenceEncoder encoder = CharSequenceEncoder.allMimeTypes();
HttpMessageWriter<CharSequence> writer = new EncoderHttpMessageWriter<>(encoder);
CancellingOutputMessage outputMessage = new CancellingOutputMessage(this.bufferFactory);
writer.write(Mono.just("foo"), ResolvableType.fromType(String.class), MediaType.TEXT_PLAIN, outputMessage, Collections.emptyMap()).block(Duration.ofSeconds(5));
}
use of cn.taketoday.core.codec.CharSequenceEncoder in project today-framework by TAKETODAY.
the class CancelWithoutDemandCodecTests method cancelWithEncoderHttpMessageWriterAndSingleValue.
// gh-22107
@Test
public void cancelWithEncoderHttpMessageWriterAndSingleValue() {
CharSequenceEncoder encoder = CharSequenceEncoder.allMimeTypes();
HttpMessageWriter<CharSequence> writer = new EncoderHttpMessageWriter<>(encoder);
CancellingOutputMessage outputMessage = new CancellingOutputMessage(this.bufferFactory);
writer.write(Mono.just("foo"), ResolvableType.fromType(String.class), MediaType.TEXT_PLAIN, outputMessage, Collections.emptyMap()).block(Duration.ofSeconds(5));
}
Aggregations