Adapt tests changed in 5.1.x to master
This commit is contained in:
@@ -19,7 +19,7 @@ import java.nio.charset.StandardCharsets;
|
||||
|
||||
import io.netty.buffer.PooledByteBufAllocator;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import reactor.core.publisher.Flux;
|
||||
|
||||
import org.springframework.core.io.buffer.DataBuffer;
|
||||
@@ -27,7 +27,7 @@ import org.springframework.core.io.buffer.LeakAwareDataBufferFactory;
|
||||
import org.springframework.core.io.buffer.NettyDataBufferFactory;
|
||||
import org.springframework.mock.http.server.reactive.test.MockServerHttpResponse;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link HttpHeadResponseDecorator}.
|
||||
@@ -51,8 +51,8 @@ public class HttpHeadResponseDecoratorTests {
|
||||
@Test
|
||||
public void write() {
|
||||
Flux<DataBuffer> body = Flux.just(toDataBuffer("data1"), toDataBuffer("data2"));
|
||||
response.writeWith(body).block();
|
||||
assertEquals(10, response.getHeaders().getContentLength());
|
||||
this.response.writeWith(body).block();
|
||||
assertThat(this.response.getHeaders().getContentLength()).isEqualTo(10);
|
||||
}
|
||||
|
||||
@Test // gh-23484
|
||||
@@ -60,7 +60,7 @@ public class HttpHeadResponseDecoratorTests {
|
||||
int length = 15;
|
||||
this.response.getHeaders().setContentLength(length);
|
||||
this.response.writeWith(Flux.empty()).block();
|
||||
assertEquals(length, this.response.getHeaders().getContentLength());
|
||||
assertThat(this.response.getHeaders().getContentLength()).isEqualTo(length);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user