@Test
public void truncateTest() throws Exception {

    MongoConnectionHandler connectionHandler = Mockito.mock(MongoConnectionHandler.class);
    Connection<MongoClient> connection = Mockito.mock(Connection.class);
    MongoClient client = Mockito.mock(MongoClient.class);
    DB database = Mockito.mock(DB.class);
    DBCollection collection = Mockito.mock(DBCollection.class);
    MongoStorageEngine mongoStorageEngine;
    when(connectionHandler.getConnection(CLUSTER_NAME)).thenReturn(connection);
    when(connection.getNativeConnection()).thenReturn(client);
    mongoStorageEngine = MongoStorageEngine.getInstance((MongoConnectionHandler) connectionHandler);
    when(client.getDB(DB_NAME)).thenReturn(database);
    //DBCollection collection = mock(DBCollection.class);
    when(client.getDB(DB_NAME)).thenReturn(database);
    when(database.getCollection(COLLECTION_NAME)).thenReturn(collection);
    TableName tableName = new TableName(DB_NAME, COLLECTION_NAME);
    when(database.collectionExists(COLLECTION_NAME)).thenReturn(true);
    mongoStorageEngine.delete(tableName, null, connection);
    verify(collection, times(1)).remove(new BasicDBObject());
}