Github user solomax commented on a diff in the pull request:

    https://github.com/apache/wicket/pull/258#discussion_r164029599
  
    --- Diff: 
wicket-core/src/test/java/org/apache/wicket/markup/head/filter/FilteringHeaderResponseTest.java
 ---
    @@ -74,4 +75,22 @@ protected Response getRealResponse()
                CharSequence realContent = 
headerResponse.getContent(filterName);
                assertEquals(headerContent, realContent.toString());
        }
    -}
    +
    +   /**
    +    * WICKET-6498 all JavaScript resources have an "defer" attribute, all 
other JavaScript is
    +    * inside a {@code document.addEventListener('DOMContentLoaded', 
function() {}; } hook.
    +    */
    +   @Test
    +   public void deferred() throws Exception
    +   {
    +           tester.getApplication().setHeaderResponseDecorator(new 
IHeaderResponseDecorator()
    --- End diff --
    
    this can be simplified to be
    ```
    tester.getApplication().setHeaderResponseDecorator(response -> new 
ResourceAggregator(new JavaScriptDeferHeaderResponse(response)));
    ```


---

Reply via email to