@@ -253,8 +253,7 @@ public void helloWorld() throws Exception {
253
253
fullTarget ("HelloWorld" ),
254
254
ImmutableList .of (
255
255
TestCase .builder ()
256
- .setExpectedResponseHeaders (ImmutableMap .of (
257
- "Content-Length" , "*" ))
256
+ .setExpectedResponseHeaders (ImmutableMap .of ("Content-Length" , "*" ))
258
257
.setExpectedResponseText ("hello\n " )
259
258
.build (),
260
259
FAVICON_TEST_CASE ,
@@ -271,23 +270,23 @@ public void bufferedWrites() throws Exception {
271
270
TestCase .builder ()
272
271
.setUrl ("/target?writes=2" )
273
272
.setExpectedResponseText ("write 0\n write 1\n " )
274
- .setExpectedResponseHeaders (ImmutableMap . of (
275
- "x-write-0" , "true" ,
276
- "x-write-1 " , "true" ,
277
- "x-written " , "true" ,
278
- "Content-Length " , "16"
279
- ))
273
+ .setExpectedResponseHeaders (
274
+ ImmutableMap . of (
275
+ "x-write-0 " , "true" ,
276
+ "x-write-1 " , "true" ,
277
+ "x-written " , "true" ,
278
+ "Content-Length" , "16" ))
280
279
.build (),
281
280
TestCase .builder ()
282
281
.setUrl ("/target?writes=2&flush=true" )
283
282
.setExpectedResponseText ("write 0\n write 1\n " )
284
- .setExpectedResponseHeaders (ImmutableMap . of (
285
- "x-write-0" , "true" ,
286
- "x-write-1 " , "true" ,
287
- "x-written " , "- " ,
288
- "Transfer-Encoding " , "chunked" ))
289
- . build ( )
290
- ));
283
+ .setExpectedResponseHeaders (
284
+ ImmutableMap . of (
285
+ "x-write-0 " , "true" ,
286
+ "x-write-1 " , "true " ,
287
+ "x-written " , "-" ,
288
+ "Transfer-Encoding" , "chunked" ) )
289
+ . build () ));
291
290
}
292
291
293
292
@ Test
@@ -728,17 +727,26 @@ private void testFunction(
728
727
.withMessage ("Response to %s is %s %s" , uri , response .getStatus (), response .getReason ())
729
728
.that (response .getStatus ())
730
729
.isEqualTo (testCase .expectedResponseCode ());
731
- testCase .expectedResponseHeaders ().ifPresent (map -> {
732
- for (Map .Entry <String , String > entry : map .entrySet ()) {
733
- if ("*" .equals (entry .getValue ())) {
734
- expect .that (response .getHeaders ().getFieldNamesCollection ()).contains (entry .getKey ());
735
- } else if ("-" .equals (entry .getValue ())) {
736
- expect .that (response .getHeaders ().getFieldNamesCollection ()).doesNotContain (entry .getKey ());
737
- } else {
738
- expect .that (response .getHeaders ().getValuesList (entry .getKey ())).contains (entry .getValue ());
739
- }
740
- }
741
- });
730
+ testCase
731
+ .expectedResponseHeaders ()
732
+ .ifPresent (
733
+ map -> {
734
+ for (Map .Entry <String , String > entry : map .entrySet ()) {
735
+ if ("*" .equals (entry .getValue ())) {
736
+ expect
737
+ .that (response .getHeaders ().getFieldNamesCollection ())
738
+ .contains (entry .getKey ());
739
+ } else if ("-" .equals (entry .getValue ())) {
740
+ expect
741
+ .that (response .getHeaders ().getFieldNamesCollection ())
742
+ .doesNotContain (entry .getKey ());
743
+ } else {
744
+ expect
745
+ .that (response .getHeaders ().getValuesList (entry .getKey ()))
746
+ .contains (entry .getValue ());
747
+ }
748
+ }
749
+ });
742
750
testCase
743
751
.expectedResponseText ()
744
752
.ifPresent (text -> expect .that (response .getContentAsString ()).isEqualTo (text ));
0 commit comments