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 /** 11 * Helps determining if stubbing should be reported as unused 12 */ 13 public class UnusedStubbingReporting { 14 15 /** 16 * Decides if the stubbing should be reported as unused. 17 * Lenient stubbings are not reported as unused. 18 */ shouldBeReported(Stubbing stubbing)19 public static boolean shouldBeReported(Stubbing stubbing) { 20 return !stubbing.wasUsed() && stubbing.getStrictness() != Strictness.LENIENT; 21 } 22 } 23