Skip to content

Commit ff6ccd0

Browse files
committed
Adapt tests changed in 5.1.x to master
1 parent 364c7c4 commit ff6ccd0

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

spring-web/src/test/java/org/springframework/http/server/reactive/HttpHeadResponseDecoratorTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919

2020
import io.netty.buffer.PooledByteBufAllocator;
2121
import org.junit.After;
22-
import org.junit.Test;
22+
import org.junit.jupiter.api.Test;
2323
import reactor.core.publisher.Flux;
2424

2525
import org.springframework.core.io.buffer.DataBuffer;
2626
import org.springframework.core.io.buffer.LeakAwareDataBufferFactory;
2727
import org.springframework.core.io.buffer.NettyDataBufferFactory;
2828
import org.springframework.mock.http.server.reactive.test.MockServerHttpResponse;
2929

30-
import static org.junit.Assert.assertEquals;
30+
import static org.assertj.core.api.Assertions.assertThat;
3131

3232
/**
3333
* Unit tests for {@link HttpHeadResponseDecorator}.
@@ -51,16 +51,16 @@ public void tearDown() {
5151
@Test
5252
public void write() {
5353
Flux<DataBuffer> body = Flux.just(toDataBuffer("data1"), toDataBuffer("data2"));
54-
response.writeWith(body).block();
55-
assertEquals(10, response.getHeaders().getContentLength());
54+
this.response.writeWith(body).block();
55+
assertThat(this.response.getHeaders().getContentLength()).isEqualTo(10);
5656
}
5757

5858
@Test // gh-23484
5959
public void writeWithGivenContentLength() {
6060
int length = 15;
6161
this.response.getHeaders().setContentLength(length);
6262
this.response.writeWith(Flux.empty()).block();
63-
assertEquals(length, this.response.getHeaders().getContentLength());
63+
assertThat(this.response.getHeaders().getContentLength()).isEqualTo(length);
6464
}
6565

6666

spring-webflux/src/test/java/org/springframework/web/reactive/resource/PathResourceResolverTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ private void testCheckResource(Resource location, String requestPath) throws IOE
110110
public void ignoreInvalidEscapeSequence() throws IOException {
111111
UrlResource location = new UrlResource(getClass().getResource("./test/"));
112112
Resource resource = location.createRelative("test%file.txt");
113-
assertTrue(this.resolver.checkResource(resource, location));
113+
assertThat(this.resolver.checkResource(resource, location)).isTrue();
114114
}
115115

116116
@Test

spring-webmvc/src/test/java/org/springframework/web/servlet/resource/PathResourceResolverTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ private void testCheckResource(Resource location, String requestPath) throws IOE
9595
public void ignoreInvalidEscapeSequence() throws IOException {
9696
UrlResource location = new UrlResource(getClass().getResource("./test/"));
9797
Resource resource = location.createRelative("test%file.txt");
98-
assertTrue(this.resolver.checkResource(resource, location));
98+
assertThat(this.resolver.checkResource(resource, location)).isTrue();
9999
}
100100

101101
@Test

0 commit comments

Comments
 (0)