ThrowsExceptionClass
Date: 2015-09-18

org.mockito.internal.stubbing.answers

## Class ThrowsExceptionClass

- java.lang.Object
- - org.mockito.internal.stubbing.answers.ThrowsExceptionClass

- All Implemented Interfaces:
    java.io.Serializable, Answer<java.lang.Object>

      public class ThrowsExceptionClass
      extends java.lang.Object
      implements Answer<java.lang.Object>, java.io.Serializable

  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ThrowsExceptionClass(java.lang.Class<? extends java.lang.Throwable> throwableClass)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Object` | `answer(InvocationOnMock invocation)`
    `java.lang.Class<? extends java.lang.Throwable>` | `getThrowableClass()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ThrowsExceptionClass

          public ThrowsExceptionClass(java.lang.Class<? extends java.lang.Throwable> throwableClass)

  - ### Method Detail

    - #### answer

          public java.lang.Object answer(InvocationOnMock invocation)
                                  throws java.lang.Throwable

      Specified by:
        `answer` in interface `Answer<java.lang.Object>`
      Parameters:
        `invocation` - the invocation on the mock.
      Returns:
        the value to be returned
      Throws:
        `java.lang.Throwable` - the throwable to be thrown

    - #### getThrowableClass

          public java.lang.Class<? extends java.lang.Throwable> getThrowableClass()