@Test
void shouldBuildResultSummaryWithPlan()
{

    Value plan = value( parameters(
            "operatorType", "Projection",
            "args", parameters( "n", 42 ),
            "identifiers", values( "a", "b" ),
            "children", values(
                    parameters(
                            "operatorType", "AllNodeScan",
                            "args", parameters( "x", 4242 ),
                            "identifiers", values( "n", "t", "f" )
                    )
            )
    ) );
    Map<String,Value> metadata = singletonMap( "plan", plan );
    ResultSummary summary = extractor.extractSummary( query(), connectionMock(), 42, metadata );
    assertTrue( summary.hasPlan() );
    assertEquals( "Projection", summary.plan().operatorType() );
    assertEquals( singletonMap( "n", value( 42 ) ), summary.plan().arguments() );
    assertEquals( asList( "a", "b" ), summary.plan().identifiers() );
    List<? extends Plan> children = summary.plan().children();
    assertEquals( 1, children.size() );
    Plan child = children.get( 0 );
    assertEquals( "AllNodeScan", child.operatorType() );
    assertEquals( singletonMap( "x", value( 4242 ) ), child.arguments() );
    assertEquals( asList( "n", "t", "f" ), child.identifiers() );
    assertEquals( 0, child.children().size() );
}