Skip to content

Instantly share code, notes, and snippets.

@mariuszs mariuszs/FooTest.java Secret
Last active Dec 28, 2015

Embed
What would you like to do?
Certain exception
import org.junit.Test;
import static com.googlecode.catchexception.CatchException.caughtException;
import static com.googlecode.catchexception.apis.BDDCatchException.then;
import static com.googlecode.catchexception.apis.BDDCatchException.when;
public class FooTest {
private SomeService foo = new SomeService();
@Test
public void testDoThat() {
when(foo).doStuff();
then(caughtException()).isExactlyInstanceOf(IndexOutOfBoundsException.class);
}
}
@sndpchatterjee07

This comment has been minimized.

Copy link

commented Aug 24, 2015

Hi, can you tell me which dependency among this list, do I need to add in my pom.xml to use this?

Thanks in advance.

@RAnders00

This comment has been minimized.

Copy link

commented Oct 14, 2015

@sndpchatterjee07 eu.codearte.catch-exception:catch-exception:1.3.3

See here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.