instanceOf

public static ExpectedException<T> instanceOf<T extends Exception>(Class<T> type)(source)

Returns an expected behavior where an exception of the given type is expected to be thrown.

Return

the expected behavior

Parameters

type

the type of the expected exception

<T>

the type of the expected exception