@Test public void testMatches() { NodeMatcher child = mock( NodeMatcher.class ); MatcherContext context = mock( MatcherContext.class ); ReportElement node = mock( ReportElement.class ); Section parent = mock( Section.class ); doReturn( true ).when( child ).matches( context, parent ); ChildMatcher matcher = new ChildMatcher( child ); assertThat( matcher.matches( context, node ), is( equalTo( false ) ) ); doReturn( parent ).when( context ).getParent( node ); assertThat( matcher.matches( context, node ), is( equalTo( true ) ) ); }
public boolean matches( final MatcherContext context, final ReportElement node ) { final Section parent = context.getParent( node ); if ( parent == null ) { return false; } return childMatcher.matches( context, parent ); }
ChildMatcher implements NodeMatcher { public boolean matches( final MatcherContext context, final ReportElement node ) { final Section parent = context.getParent( node ); if ( parent == null ) { return false; } return childMatcher.matches( context, parent ); } }
ChildMatcher implements NodeMatcher { public boolean matches( final MatcherContext context, final ReportElement node ) { final Section parent = context.getParent( node ); if ( parent == null ) { return false; } return childMatcher.matches( context, parent ); } ChildMatcher( final NodeMatcher childMatcher ); }
ChildMatcher implements NodeMatcher { public boolean matches( final MatcherContext context, final ReportElement node ) { final Section parent = context.getParent( node ); if ( parent == null ) { return false; } return childMatcher.matches( context, parent ); } ChildMatcher( final NodeMatcher childMatcher ); boolean matches( final MatcherContext context, final ReportElement node ); String toString(); }
ChildMatcher implements NodeMatcher { public boolean matches( final MatcherContext context, final ReportElement node ) { final Section parent = context.getParent( node ); if ( parent == null ) { return false; } return childMatcher.matches( context, parent ); } ChildMatcher( final NodeMatcher childMatcher ); boolean matches( final MatcherContext context, final ReportElement node ); String toString();  }