Skip to content

Instantly share code, notes, and snippets.

@mariuszs
Last active December 28, 2015 10:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mariuszs/23f4e1e1857c28449b61 to your computer and use it in GitHub Desktop.
Save mariuszs/23f4e1e1857c28449b61 to your computer and use it in GitHub Desktop.
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
Copy link

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
Copy link

@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