コード例 #1
0
 @Test(expected = MongoException.class)
 public void createConnectionException2Test() {
   try {
     when(mongo.getDB(anyString())).thenThrow(MongoException.class);
   } catch (Exception ex) {
     fail(ex.getLocalizedMessage());
   }
   MongoDAOFactory.createConnection();
 }
コード例 #2
0
 @Test
 public void createConnection3Test() {
   MongoDAOFactory.createConnection();
   verify(mongo).getDB(anyString());
 }