Skip to content

Instantly share code, notes, and snippets.

@billy-bacon
Created October 9, 2013 20:41
Show Gist options
  • Save billy-bacon/6907969 to your computer and use it in GitHub Desktop.
Save billy-bacon/6907969 to your computer and use it in GitHub Desktop.
test
@Test
public void should_throw_exception_for_configure() throws Exception {
// setup test
module = new AWSModule();
final Binder binder = mock(Binder.class);
when(binder.skipSources(any(Class.class))).thenThrow(new IOException("WTF"));
try {
module.configure(binder);
fail("should have thrown an exception on module.configure(binder)");
} catch(Exception e) {
// describe and verify expected behavior
// success, an exception should have been thrown
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment