Adapt tests changed in 5.1.x to master
This commit is contained in:
parent
364c7c459d
commit
ff6ccd0d04
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ public class PathResourceResolverTests {
|
|||
public void ignoreInvalidEscapeSequence() throws IOException {
|
||||
UrlResource location = new UrlResource(getClass().getResource("./test/"));
|
||||
Resource resource = location.createRelative("test%file.txt");
|
||||
assertTrue(this.resolver.checkResource(resource, location));
|
||||
assertThat(this.resolver.checkResource(resource, location)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ public class PathResourceResolverTests {
|
|||
public void ignoreInvalidEscapeSequence() throws IOException {
|
||||
UrlResource location = new UrlResource(getClass().getResource("./test/"));
|
||||
Resource resource = location.createRelative("test%file.txt");
|
||||
assertTrue(this.resolver.checkResource(resource, location));
|
||||
assertThat(this.resolver.checkResource(resource, location)).isTrue();
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
|||
Loading…
Reference in New Issue