March 2018
Intermediate to advanced
324 pages
8h 30m
English
Finally, let us make sure that the drop method returns false in case of an Exception:
@Test
public void givenExceptionWhenDropThenReturnFalse() {
doThrow(new MongoException("Bla")).when(mongoCollection).drop();
doReturn(mongoCollection).when(collection).getMongoCollection();
assertFalse(collection.drop());
}
Read now
Unlock full access