@@ -253,8 +253,7 @@ public void helloWorld() throws Exception {
253253 fullTarget ("HelloWorld" ),
254254 ImmutableList .of (
255255 TestCase .builder ()
256- .setExpectedResponseHeaders (ImmutableMap .of (
257- "Content-Length" , "*" ))
256+ .setExpectedResponseHeaders (ImmutableMap .of ("Content-Length" , "*" ))
258257 .setExpectedResponseText ("hello\n " )
259258 .build (),
260259 FAVICON_TEST_CASE ,
@@ -271,23 +270,23 @@ public void bufferedWrites() throws Exception {
271270 TestCase .builder ()
272271 .setUrl ("/target?writes=2" )
273272 .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" ))
280279 .build (),
281280 TestCase .builder ()
282281 .setUrl ("/target?writes=2&flush=true" )
283282 .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 () ));
291290 }
292291
293292 @ Test
@@ -728,17 +727,26 @@ private void testFunction(
728727 .withMessage ("Response to %s is %s %s" , uri , response .getStatus (), response .getReason ())
729728 .that (response .getStatus ())
730729 .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+ });
742750 testCase
743751 .expectedResponseText ()
744752 .ifPresent (text -> expect .that (response .getContentAsString ()).isEqualTo (text ));
0 commit comments