1
1
/*
2
- * Copyright 2002-2018 the original author or authors.
2
+ * Copyright 2002-2019 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
23
23
import java .util .List ;
24
24
import java .util .Map ;
25
25
26
- import org .junit .Before ;
27
26
import org .junit .Test ;
28
- import org .reactivestreams .Publisher ;
29
27
import reactor .core .publisher .Flux ;
30
28
import reactor .core .publisher .Mono ;
31
29
import reactor .core .publisher .UnicastProcessor ;
@@ -58,13 +56,7 @@ public class MultipartHttpMessageWriterTests extends AbstractLeakCheckingTestCas
58
56
private final MultipartHttpMessageWriter writer =
59
57
new MultipartHttpMessageWriter (ClientCodecConfigurer .create ().getWriters ());
60
58
61
- private MockServerHttpResponse response ;
62
-
63
-
64
- @ Before
65
- public void setUp () {
66
- this .response = new MockServerHttpResponse (this .bufferFactory );
67
- }
59
+ private final MockServerHttpResponse response = new MockServerHttpResponse (this .bufferFactory );
68
60
69
61
70
62
@ Test
@@ -86,7 +78,6 @@ public void canWrite() {
86
78
87
79
@ Test
88
80
public void writeMultipart () throws Exception {
89
-
90
81
Resource logo = new ClassPathResource ("/org/springframework/http/converter/logo.jpg" );
91
82
Resource utf8 = new ClassPathResource ("/org/springframework/http/converter/logo.jpg" ) {
92
83
@ Override
@@ -175,7 +166,7 @@ private String decodeToString(Part part) {
175
166
Collections .emptyMap ()).block (Duration .ZERO );
176
167
}
177
168
178
- @ Test // SPR-16402
169
+ @ Test // SPR-16402
179
170
public void singleSubscriberWithResource () throws IOException {
180
171
UnicastProcessor <Resource > processor = UnicastProcessor .create ();
181
172
Resource logo = new ClassPathResource ("/org/springframework/http/converter/logo.jpg" );
@@ -217,7 +208,7 @@ public void singleSubscriberWithStrings() {
217
208
this .response .getBodyAsString ().block (Duration .ofSeconds (5 ));
218
209
}
219
210
220
- @ Test // SPR-16376
211
+ @ Test // SPR-16376
221
212
public void customContentDisposition () throws IOException {
222
213
Resource logo = new ClassPathResource ("/org/springframework/http/converter/logo.jpg" );
223
214
Flux <DataBuffer > buffers = DataBufferUtils .read (logo , new DefaultDataBufferFactory (), 1024 );
0 commit comments