public boolean isOut(Stubbing s) { return !UnusedStubbingReporting.shouldBeReported(s); } });
private static List<Invocation> potentialArgMismatches(Invocation invocation, Collection<Stubbing> stubbings) { List<Invocation> matchingStubbings = new LinkedList<Invocation>(); for (Stubbing s : stubbings) { if (UnusedStubbingReporting.shouldBeReported(s) && s.getInvocation().getMethod().getName().equals(invocation.getMethod().getName()) //If stubbing and invocation are in the same source file we assume they are in the test code, // and we don't flag it as mismatch: && !s.getInvocation().getLocation().getSourceFile().equals(invocation.getLocation().getSourceFile())) { matchingStubbings.add(s.getInvocation()); } } return matchingStubbings; }
if (!UnusedStubbingReporting.shouldBeReported(s)) { String location = s.getInvocation().getLocation().toString(); locationsOfUsedStubbings.add(location);