Developing Tic-Tac-Toe v2

We'll continue where we left off with Tic-Tac-Toe in Chapter 3, Red-Green-Refactor – From Failure Through Success until Perfection. The complete source code of the application developed so far can be found at https://bitbucket.org/vfarcic/tdd-java-ch06-tic-tac-toe-mongo.git. Use the VCS|Checkout from Version Control|Git option from the IntelliJ IDEA to clone the code. As with any other project, the first thing we need to do is add the dependencies to build.gradle:

dependencies { 
    compile 'org.jongo:jongo:1.1' 
    compile 'org.mongodb:mongo-java-driver:2.+' 
    testCompile 'junit:junit:4.12' 
    testCompile 'org.mockito:mockito-all:1.+' 
} 

Importing the MongoDB driver should be self-explanatory. Jongo is a very helpful set of utility methods that make working with Java code much more similar to the Mongo query language. For the testing part, we'll continue using JUnit with the addition of Mockito mocks, spies, and validations.

You'll notice that we won't install MongoDB until the very end. With Mockito, we will not need it, since all our Mongo dependencies will be mocked.

Once dependencies are specified, remember to refresh them in the IDEA Gradle Projects dialogue.

The source code can be found in the 00-prerequisites branch of the tdd-java-ch06-tic-tac-toe-mongo Git repository (https://bitbucket.org/vfarcic/tdd-java-ch06-tic-tac-toe-mongo/branch/00-prerequisites).

Now that we have prerequisites set, let's start working on the first requirement.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.149.242.175