Browse Source

Fix broken test

pull/22938/head
Sam Brannen 6 years ago
parent
commit
d8f1d56100
  1. 2
      spring-web/src/test/java/org/springframework/http/codec/EncoderHttpMessageWriterTests.java

2
spring-web/src/test/java/org/springframework/http/codec/EncoderHttpMessageWriterTests.java

@ -183,7 +183,7 @@ public class EncoderHttpMessageWriterTests { @@ -183,7 +183,7 @@ public class EncoderHttpMessageWriterTests {
public void isStreamingMediaType() throws InvocationTargetException, IllegalAccessException {
HttpMessageWriter<String> writer = getWriter(TEXT_HTML);
MediaType streamingMediaType = new MediaType(TEXT_PLAIN, Collections.singletonMap("streaming", "true"));
when(this.encoder.getStreamingMediaTypes()).thenReturn(Arrays.asList(streamingMediaType));
given(this.encoder.getStreamingMediaTypes()).willReturn(Arrays.asList(streamingMediaType));
Method method = ReflectionUtils.findMethod(writer.getClass(), "isStreamingMediaType", MediaType.class);
ReflectionUtils.makeAccessible(method);
assertTrue((Boolean) method.invoke(writer, streamingMediaType));

Loading…
Cancel
Save