LicketComponentTreeWalkSequence { public static Builder source(LicketComponent<?> source) { return new Builder(source); } private  LicketComponentTreeWalkSequence(LicketComponent<?> source, LicketComponent<?> target); static Builder source(LicketComponent<?> source); final AbstractAstNodeBuilder<?> generateTreeWalkSequence();  }
@Test public void shouldGenerateProperSequenceWhenTargetIsChildOfSourceAtAnyLevel() { AbstractAstNodeBuilder<?> sequence = source(levelA2).target(levelA5).traverseSequence(); assertThat(sequence.build().toSource()) .isEqualTo("this.$parent.$refs[\"levelA3\"].$refs[\"levelA4\"].$refs[\"levelA5\"]"); sequence = source(levelA5).target(levelB6).traverseSequence(); assertThat(sequence.build().toSource()).isEqualTo( "this.$parent.$parent.$parent.$parent.$refs[\"levelB2\"].$refs[\"levelB3\"].$refs[\"levelB4\"].$refs[\"levelB5\"].$refs[\"levelB6\"]"); sequence = source(levelA1).target(levelA5).traverseSequence(); assertThat(sequence.build().toSource()).isEqualTo("this.$refs[\"levelA2\"].$refs[\"levelA3\"].$refs[\"levelA4\"].$refs[\"levelA5\"]"); sequence = source(levelA2).target(levelB2).traverseSequence(); assertThat(sequence.build().toSource()).isEqualTo("this.$parent.$refs[\"levelB2\"]"); }