• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2017 Mockito contributors
3  * This program is made available under the terms of the MIT License.
4  */
5 package org.mockito.internal.stubbing;
6 
7 import org.mockito.quality.Strictness;
8 import org.mockito.stubbing.Stubbing;
9 
10 /** Helps determining if stubbing should be reported as unused */
11 public final class UnusedStubbingReporting {
12 
13     /**
14      * Decides if the stubbing should be reported as unused.
15      * Lenient stubbings are not reported as unused.
16      */
shouldBeReported(Stubbing stubbing)17     public static boolean shouldBeReported(Stubbing stubbing) {
18         return !stubbing.wasUsed() && stubbing.getStrictness() != Strictness.LENIENT;
19     }
20 
UnusedStubbingReporting()21     private UnusedStubbingReporting() {}
22 }
23