2 * Copyright (c) 2016 Red Hat and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
8 package org.opendaylight.yangtools.testutils.mockito;
10 import java.lang.reflect.Method;
11 import org.mockito.internal.util.MockUtil;
14 * Exception to be thrown on unstubbed method calls.
16 * @author Michael Vorburger
18 public class UnstubbedMethodException extends UnsupportedOperationException {
19 private static final long serialVersionUID = 1L;
21 public UnstubbedMethodException(Method method) {
22 super(MethodExtensions.toString(method) + " is not stubbed in mock of " + method.getDeclaringClass().getName());
25 public UnstubbedMethodException(Method method, Object mockAbstractFakeObject) {
26 super(MethodExtensions.toString(method) + " is not implemented in "
27 + new MockUtil().getMockName(mockAbstractFakeObject).toString());