Code example for Predicate

Methods: apply

0
     */ 
    @Test
    public void rendersTruePipeWhenPredicateIsTrue() 
            throws ServletException, IOException {
 
        when(predicate.apply(request)).thenReturn(true);
 
        branchingRenderingPipeline.renderState(request, response);
 
        verify(truePipe).renderState(request, response);
 
        verifyZeroInteractions(falsePipe);
    } 
 
    /** 
     * Test that when the Predicate is false, proceeds down false pipe and ignores true pipe. 
     * 
     * @throws ServletException would be a test failure 
     * @throws IOException would be a test failure 
     */