Skip to content

Commit

Permalink
pmd warnings in CountCallsTest
Browse files Browse the repository at this point in the history
  • Loading branch information
soloturn committed Nov 26, 2023
1 parent c0d90fa commit 28d1db6
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
import org.terasology.engine.logic.behavior.core.DelegateNode;

import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;

import static org.junit.jupiter.api.Assertions.assertEquals;

Expand Down Expand Up @@ -49,16 +51,12 @@ public void assertBT(String tree, List<BehaviorState> result, List<Integer> exec
assertBT(tree, result, executed, true);
}

public void assertBT(String tree, List<BehaviorState> result, List<Integer> executed, boolean step) {
public void assertBT(String tree, List<BehaviorState> result, List<Integer> executed, boolean ignoredStep) {
BehaviorNode node = fromJson(tree);

node.construct(null);
List<BehaviorState> actualStates = Lists.newArrayList();
for (int i = 0; i < result.size(); i++) {
BehaviorState state = node.execute(null);
actualStates.add(state);

}
List<BehaviorState> actualStates =
IntStream.range(0, result.size()).mapToObj(i -> node.execute(null)).collect(Collectors.toList());
node.destruct(null);

assertEquals(result, actualStates);
Expand Down

0 comments on commit 28d1db6

Please sign in to comment.