package com.taxtelecom.chelnyedu.dropwizard;

import static org.fest.assertions.api.Assertions.assertThat;
import javax.ws.rs.core.Response;
import org.junit.Test;
import com.taxtelecom.chelnyedu.dropwizard.representations.Contact;
import com.taxtelecom.chelnyedu.dropwizard.resources.ContactResources;
/**
 * Created by sagel on 06.07.17.
 */
public class TestApplication {
    private Contact contactForTest = new Contact(0, "John", "Doe", "+123456789");

    @Test
    public void checkContact(){
        ContactResources resources = new ContactResources();
        Response contact = resources.getContact(0);
        Contact con = (Contact) contact.getEntity();

        assertThat(contactForTest.getFirstName()).isEqualTo(con.getFirstName());
        assertThat(contactForTest.getLastName()).isEqualTo(con.getLastName());
        assertThat(contactForTest.getPhone()).isEqualTo(con.getPhone());

    }
}

@@ -449,16 +449,130 @@
 56789%22);
+%0A    private Contact emptyContact = new Contact();%0A    private Contact contact = new Contact(0, null, null, null);
 %0A%0A    @T
@@ -1007,16 +1007,437 @@
 one());%0A
+        assertThat(contactForTest.getId()).isEqualTo(con.getId());%0A    %7D%0A%0A    @Test%0A    public void checkEmpty()%7B%0A        assertThat(emptyContact.getFirstName()).isEqualTo(contact.getFirstName());%0A        assertThat(emptyContact.getLastName()).isEqualTo(contact.getLastName());%0A        assertThat(emptyContact.getPhone()).isEqualTo(contact.getPhone());%0A        assertThat(emptyContact.getId()).isEqualTo(contact.getId());
 %0A    %7D%0A%7D

Test for constructor and getId() by Sagel