Refactor CodecConfigurer
This commit refactors the CodecConfigurer, with it's subtypes ServerCodecConfigurer and ClientCodecConfigurerTests, into interfaces instead of classes.
This commit is contained in:
@@ -53,7 +53,7 @@ import static org.springframework.core.ResolvableType.forClass;
|
||||
*/
|
||||
public class ClientCodecConfigurerTests {
|
||||
|
||||
private final ClientCodecConfigurer configurer = new ClientCodecConfigurer();
|
||||
private final ClientCodecConfigurer configurer = new DefaultClientCodecConfigurer();
|
||||
|
||||
private final AtomicInteger index = new AtomicInteger(0);
|
||||
|
||||
|
||||
@@ -44,12 +44,12 @@ import static org.mockito.Mockito.*;
|
||||
import static org.springframework.core.ResolvableType.forClass;
|
||||
|
||||
/**
|
||||
* Unit tests for {@link ServerCodecConfigurer}.
|
||||
* Unit tests for {@link org.springframework.http.codec.DefaultCodecConfigurer.AbstractDefaultCodecsConfigurer}.
|
||||
* @author Rossen Stoyanchev
|
||||
*/
|
||||
public class CodecConfigurerTests {
|
||||
|
||||
private final TestCodecConfigurer configurer = new TestCodecConfigurer();
|
||||
private final CodecConfigurer configurer = new DefaultCodecConfigurer(new TestDefaultCodecConfigurer());
|
||||
|
||||
private final AtomicInteger index = new AtomicInteger(0);
|
||||
|
||||
@@ -276,14 +276,9 @@ public class CodecConfigurerTests {
|
||||
}
|
||||
|
||||
|
||||
private static class TestCodecConfigurer extends AbstractCodecConfigurer {
|
||||
|
||||
private TestCodecConfigurer() {
|
||||
super(new TestDefaultCodecConfigurer());
|
||||
}
|
||||
|
||||
|
||||
private static class TestDefaultCodecConfigurer extends DefaultCodecConfigurer {
|
||||
private static class TestDefaultCodecConfigurer extends DefaultCodecConfigurer.AbstractDefaultCodecsConfigurer {
|
||||
|
||||
@Override
|
||||
protected void addStringReaderTextOnlyTo(List<HttpMessageReader<?>> result) {
|
||||
@@ -295,6 +290,5 @@ public class CodecConfigurerTests {
|
||||
addReaderTo(result, () -> new DecoderHttpMessageReader<>(StringDecoder.allMimeTypes(true)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ import static org.springframework.core.ResolvableType.forClass;
|
||||
*/
|
||||
public class ServerCodecConfigurerTests {
|
||||
|
||||
private final ServerCodecConfigurer configurer = new ServerCodecConfigurer();
|
||||
private final ServerCodecConfigurer configurer = new DefaultServerCodecConfigurer();
|
||||
|
||||
private final AtomicInteger index = new AtomicInteger(0);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user