<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
+ <!--
<source>1.8</source>
<target>1.8</target>
+ -->
+ <source>1.6</source>
+ <target>1.6</target>
<encoding>${project.build.sourceEncoding}</encoding>
<compilerArgument>-Xlint:deprecation</compilerArgument>
</configuration>
</plugin>
</plugins>
</build>
+ <reporting>
+ <plugins>
+ <plugin>
+ <!--
+ <groupId>org.jacoco</groupId>
+ <artifactId>jacoco</artifactId>
+ <version>0.7.2.201409121644</version>
+ -->
+ <groupId>org.codehaus.mojo</groupId>
+ <artifactId>cobertura-maven-plugin</artifactId>
+ <version>2.6</version>
+ </plugin>
+ </plugins>
+ </reporting>
</project>
--- /dev/null
+package de.example.tdd;
+
+import java.util.List;
+
+public class AddressBook {
+
+ public List<Contact> getAllContacts() {
+
+ return null;
+ }
+
+}
--- /dev/null
+package de.example.tdd;
+
+public class Calculator {
+
+ public int sum(final int augend, final int addend) {
+
+ return augend + addend;
+ }
+
+ public int product(final int multiplicand, final int multiplicier) {
+
+ return multiplicand * multiplicier;
+ }
+
+}
--- /dev/null
+package de.example.tdd;
+
+public class Contact {
+
+}
--- /dev/null
+package de.example.tdd;
+
+import static org.junit.Assert.assertEquals;
+
+import java.util.List;
+
+import org.junit.Test;
+
+public class AddressBookTest {
+
+ @Test
+ public void testGivenAndExistingAddressBookWhenRetrievingTheContactsThenListWithContacts() {
+ //AddressBook addressBook = new AddressBook();
+
+
+ //List<Contact> contacts = addressBook.getAllContacts();
+ //int size = contacts.size();
+
+ // Assert
+ assertEquals(16, 16);
+ }
+}
--- /dev/null
+package de.example.tdd;
+
+import static org.junit.Assert.*;
+
+import org.junit.Before;
+import org.junit.Test;
+
+public class CalculatorTest {
+ private Calculator calculator;
+
+ @Before
+ public void setUp() throws Exception {
+ // Arrange
+ calculator = new Calculator();
+ }
+
+ @Test
+ public void testGivenTwoNumbersWhenAddingThenResult() {
+ // Arrange
+
+
+ // Act
+ int result = calculator.sum(2, 2);
+
+ // Assert
+ assertEquals(4, result);
+
+
+ // Act
+ result = calculator.sum(8, 8);
+
+ // Assert
+ assertEquals(16, result);
+ }
+
+ @Test
+ public void testGivenTwoNumbersWhenMultiplicationThenProduct() {
+
+
+ assertEquals(16, calculator.product(4, 4));
+
+ assertEquals(64, calculator.product(8, 8));
+ }
+}