@Test public void testVerifyRoutingPolicies() { Configuration c = new Configuration("c", ConfigurationFormat.CISCO_IOS); RoutingPolicy rp = new RoutingPolicy("rp", c); rp.setStatements( ImmutableList.of(new SetCommunities(new CommunitySetExprReference("undefined")))); c.setRoutingPolicies(ImmutableMap.of("rp", rp)); CommunityStructuresVerifier v = new CommunityStructuresVerifier(c); _thrown.expect(VendorConversionException.class); _thrown.expectMessage(containsString("Undefined reference")); v.verifyRoutingPolicies(); }
@VisibleForTesting void verifyRoutingPolicies() { _ctx._routingPolicies.values().stream() .flatMap(rp -> rp.getStatements().stream()) .forEach(s -> s.accept(STATEMENT_VERIFIER, _ctx)); }
CommunityStructuresVerifier { @VisibleForTesting void verifyRoutingPolicies() { _ctx._routingPolicies.values().stream() .flatMap(rp -> rp.getStatements().stream()) .forEach(s -> s.accept(STATEMENT_VERIFIER, _ctx)); } }
CommunityStructuresVerifier { @VisibleForTesting void verifyRoutingPolicies() { _ctx._routingPolicies.values().stream() .flatMap(rp -> rp.getStatements().stream()) .forEach(s -> s.accept(STATEMENT_VERIFIER, _ctx)); } @VisibleForTesting  CommunityStructuresVerifier(Configuration c); }
CommunityStructuresVerifier { @VisibleForTesting void verifyRoutingPolicies() { _ctx._routingPolicies.values().stream() .flatMap(rp -> rp.getStatements().stream()) .forEach(s -> s.accept(STATEMENT_VERIFIER, _ctx)); } @VisibleForTesting  CommunityStructuresVerifier(Configuration c); static void verify(Configuration configuration); }
CommunityStructuresVerifier { @VisibleForTesting void verifyRoutingPolicies() { _ctx._routingPolicies.values().stream() .flatMap(rp -> rp.getStatements().stream()) .forEach(s -> s.accept(STATEMENT_VERIFIER, _ctx)); } @VisibleForTesting  CommunityStructuresVerifier(Configuration c); static void verify(Configuration configuration);  }