@@ -0,0 +1,1458 @@
+package br.com.aurum.astrea;%0A%0Aimport br.com.aurum.astrea.controller.ContactController;%0Aimport br.com.aurum.astrea.dao.ContactDao;%0Aimport br.com.aurum.astrea.domain.Contact;%0Aimport br.com.aurum.astrea.exception.ValidationException;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0A%0Aimport java.util.*;%0Aimport static org.mockito.Mockito.*;%0A%0A/**%0A * Created by diegom on 07/06/2017.%0A */%0Apublic class CreateContactTest %7B%0A    private ContactDao mockDAO;%0A    private Contact contactDiego;%0A    private ContactController controller;%0A%0A    @Before%0A    public void setup() %7B%0A        mockDAO = mock(ContactDao.class);%0A        contactDiego = createContact(%22Diego Melo%22, %22diegomeloadm@gmail.com%22);%0A        controller = new ContactController(mockDAO);%0A    %7D%0A%0A    private Contact createContact(String name, String email) %7B%0A        Contact contact = new Contact();%0A        contact.setName(name);%0A        contact.setEmails(Arrays.asList(new String%5B%5D%7Bemail%7D));%0A        return contact;%0A    %7D%0A%0A    @Test%0A    public void createAContact() throws ValidationException %7B%0A        doNothing().when(mockDAO).save(contactDiego);%0A        controller.save(contactDiego);%0A        verify(mockDAO, times(1)).save(contactDiego);%0A    %7D%0A%0A    @Test(expected = ValidationException.class)%0A    public void validateNameWhenCreateContact() throws ValidationException %7B%0A        contactDiego.setName(%22%22);%0A        doNothing().when(mockDAO).save(contactDiego);%0A        controller.save(contactDiego);%0A    %7D%0A%7D%0A

add testes para criação de contato