Skip to content

Commit 6410f18

Browse files
fluentfuturenetdpb
authored andcommitted
Add @DoNotMock to Traverser.
RELNOTES=Add @DoNotMock to Traverser ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=321469875
1 parent da93601 commit 6410f18

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

android/guava-tests/test/com/google/common/graph/TraverserTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@ public void forGraph_depthFirstPreOrderIterable_javadocExample_canBeIteratedMult
383383
@Test
384384
public void forGraph_depthFirstPreOrder_infinite() {
385385
Iterable<Integer> result =
386-
Traverser.forGraph(fixedSuccessors(Iterables.cycle(1, 2, 3))).breadthFirst(0);
387-
assertThat(Iterables.limit(result, 2)).containsExactly(0, 1).inOrder();
386+
Traverser.forGraph(fixedSuccessors(Iterables.cycle(1, 2, 3))).depthFirstPreOrder(0);
387+
assertThat(Iterables.limit(result, 3)).containsExactly(0, 1, 2).inOrder();
388388
}
389389

390390
@Test

android/guava/src/com/google/common/graph/Traverser.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.google.common.annotations.Beta;
2323
import com.google.common.collect.AbstractIterator;
2424
import com.google.common.collect.ImmutableSet;
25+
import com.google.errorprone.annotations.DoNotMock;
2526
import java.util.ArrayDeque;
2627
import java.util.Deque;
2728
import java.util.HashSet;
@@ -59,6 +60,9 @@
5960
* @since 23.1
6061
*/
6162
@Beta
63+
@DoNotMock(
64+
"Call forGraph or forTree, passing a lambda or a Graph with the desired edges (built with"
65+
+ " GraphBuilder)")
6266
public abstract class Traverser<N> {
6367
private final SuccessorsFunction<N> successorFunction;
6468

guava-tests/test/com/google/common/graph/TraverserTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,8 @@ public void forGraph_depthFirstPreOrderIterable_javadocExample_canBeIteratedMult
383383
@Test
384384
public void forGraph_depthFirstPreOrder_infinite() {
385385
Iterable<Integer> result =
386-
Traverser.forGraph(fixedSuccessors(Iterables.cycle(1, 2, 3))).breadthFirst(0);
387-
assertThat(Iterables.limit(result, 2)).containsExactly(0, 1).inOrder();
386+
Traverser.forGraph(fixedSuccessors(Iterables.cycle(1, 2, 3))).depthFirstPreOrder(0);
387+
assertThat(Iterables.limit(result, 3)).containsExactly(0, 1, 2).inOrder();
388388
}
389389

390390
@Test

guava/src/com/google/common/graph/Traverser.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
import com.google.common.annotations.Beta;
2323
import com.google.common.collect.AbstractIterator;
2424
import com.google.common.collect.ImmutableSet;
25+
import com.google.errorprone.annotations.DoNotMock;
2526
import java.util.ArrayDeque;
2627
import java.util.Deque;
2728
import java.util.HashSet;
@@ -59,6 +60,9 @@
5960
* @since 23.1
6061
*/
6162
@Beta
63+
@DoNotMock(
64+
"Call forGraph or forTree, passing a lambda or a Graph with the desired edges (built with"
65+
+ " GraphBuilder)")
6266
public abstract class Traverser<N> {
6367
private final SuccessorsFunction<N> successorFunction;
6468

0 commit comments

Comments
 (0)