Polishing
- Renamed `defaultCodec` to `defaultCodecs`, and `customCodec` to `customCodecs` - Added `@Override` annotations where necessary - Fixed non-parameterized usage for parameterized types.
This commit is contained in:
@@ -63,11 +63,7 @@ import org.springframework.web.reactive.result.view.freemarker.FreeMarkerViewRes
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
import org.springframework.web.server.WebHandler;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.*;
|
||||
import static org.springframework.core.ResolvableType.forClass;
|
||||
import static org.springframework.core.ResolvableType.forClassWithGenerics;
|
||||
import static org.springframework.http.MediaType.APPLICATION_FORM_URLENCODED;
|
||||
@@ -301,10 +297,10 @@ public class WebFluxConfigurationSupportTests {
|
||||
@Override
|
||||
protected void configureHttpMessageCodecs(ServerCodecConfigurer configurer) {
|
||||
configurer.registerDefaults(false);
|
||||
configurer.customCodec().decoder(StringDecoder.textPlainOnly(true));
|
||||
configurer.customCodec().decoder(new Jaxb2XmlDecoder());
|
||||
configurer.customCodec().encoder(CharSequenceEncoder.textPlainOnly());
|
||||
configurer.customCodec().encoder(new Jaxb2XmlEncoder());
|
||||
configurer.customCodecs().decoder(StringDecoder.textPlainOnly(true));
|
||||
configurer.customCodecs().decoder(new Jaxb2XmlDecoder());
|
||||
configurer.customCodecs().encoder(CharSequenceEncoder.textPlainOnly());
|
||||
configurer.customCodecs().encoder(new Jaxb2XmlEncoder());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
*/
|
||||
package org.springframework.web.reactive.result.method.annotation;
|
||||
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
@@ -48,8 +47,7 @@ import org.springframework.web.reactive.result.method.SyncInvocableHandlerMethod
|
||||
import org.springframework.web.server.ResponseStatusException;
|
||||
import org.springframework.web.server.ServerWebExchange;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.*;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link ControllerMethodResolver}.
|
||||
@@ -70,8 +68,8 @@ public class ControllerMethodResolverTests {
|
||||
resolvers.addCustomResolver(new CustomSyncArgumentResolver());
|
||||
|
||||
ServerCodecConfigurer codecs = new ServerCodecConfigurer();
|
||||
codecs.customCodec().decoder(new ByteArrayDecoder());
|
||||
codecs.customCodec().decoder(new ByteBufferDecoder());
|
||||
codecs.customCodecs().decoder(new ByteArrayDecoder());
|
||||
codecs.customCodecs().decoder(new ByteBufferDecoder());
|
||||
|
||||
AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();
|
||||
applicationContext.registerBean(TestControllerAdvice.class);
|
||||
|
||||
Reference in New Issue
Block a user