File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
spring-web/src/test/java/org/springframework/http/codec/support Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 17
17
package org .springframework .http .codec .support ;
18
18
19
19
import java .util .List ;
20
+ import java .util .concurrent .atomic .AtomicBoolean ;
20
21
import java .util .concurrent .atomic .AtomicInteger ;
21
22
import java .util .stream .Collectors ;
22
23
@@ -336,6 +337,18 @@ public void cloneDefaultCodecs() {
336
337
assertThat (encoders ).doesNotContain (jacksonEncoder , jaxb2Encoder , protoEncoder );
337
338
}
338
339
340
+ @ Test
341
+ void withDefaultCodecConfig () {
342
+ AtomicBoolean callbackCalled = new AtomicBoolean (false );
343
+ this .configurer .defaultCodecs ().enableLoggingRequestDetails (true );
344
+ this .configurer .customCodecs ().withDefaultCodecConfig (config -> {
345
+ assertThat (config .isEnableLoggingRequestDetails ()).isTrue ();
346
+ callbackCalled .compareAndSet (false , true );
347
+ });
348
+ this .configurer .getReaders ();
349
+ assertThat (callbackCalled ).isTrue ();
350
+ }
351
+
339
352
private Decoder <?> getNextDecoder (List <HttpMessageReader <?>> readers ) {
340
353
HttpMessageReader <?> reader = readers .get (this .index .getAndIncrement ());
341
354
assertThat (reader .getClass ()).isEqualTo (DecoderHttpMessageReader .class );
You can’t perform that action at this time.
0 commit comments