LambdaRestrictionStrategy extends AbstractTraversalStrategy<TraversalStrategy.VerificationStrategy> implements TraversalStrategy.VerificationStrategy { public static LambdaRestrictionStrategy instance() { return INSTANCE; } private  LambdaRestrictionStrategy(); @Override void apply(final Traversal.Admin<?, ?> traversal); static LambdaRestrictionStrategy instance();  }
@Test public void shouldBeVerifiedIllegal() { final TraversalStrategies strategies = new DefaultTraversalStrategies(); strategies.addStrategies(ProfileStrategy.instance()); strategies.addStrategies(LambdaRestrictionStrategy.instance()); traversal.asAdmin().setStrategies(strategies); if (allow) { traversal.asAdmin().applyStrategies(); } else { try { traversal.asAdmin().applyStrategies(); fail("The strategy should not allow lambdas: " + this.traversal); } catch (VerificationException ise) { assertTrue(ise.getMessage().contains("lambda")); } } }
@Test public void shouldBeVerifiedIllegal() { final TraversalStrategies strategies = new DefaultTraversalStrategies(); strategies.addStrategies(LambdaRestrictionStrategy.instance()); traversal.asAdmin().setStrategies(strategies); if (allow) { traversal.asAdmin().applyStrategies(); } else { try { traversal.asAdmin().applyStrategies(); fail("The strategy should not allow lambdas: " + this.traversal); } catch (VerificationException ise) { assertTrue(ise.getMessage().contains("lambda")); } } }