March 2018
Intermediate to advanced
324 pages
8h 30m
English
Let us just add a try/catch block:
public boolean drop() {
try {
getMongoCollection().drop();
return true;
} catch (Exception e) {
return false;
}
}
With this implementation, we are finished with the TicTacToeCollection class that acts as a layer between our main class and MongoDB.
The source code can be found in the 02-save-move branch of the tdd-java-ch06-tic-tac-toe-mongo Git repository (https://bitbucket.org/vfarcic/tdd-java-ch06-tic-tac-toe-mongo/branch/02-save-move). The classes in particular are TicTacToeCollectionSpec and TicTacToeCollection.
Read now
Unlock full access