Search in sources :

Example 6 with Person

use of com.example.helloworld.core.Person in project dropwizard by dropwizard.

the class PersonResourceTest method setup.

@Before
public void setup() {
    person = new Person();
    person.setId(1L);
}
Also used : Person(com.example.helloworld.core.Person) Before(org.junit.Before)

Example 7 with Person

use of com.example.helloworld.core.Person in project dropwizard by dropwizard.

the class PersonResourceTest method getPersonSuccess.

@Test
public void getPersonSuccess() {
    when(DAO.findById(1L)).thenReturn(Optional.of(person));
    Person found = RULE.target("/people/1").request().get(Person.class);
    assertThat(found.getId()).isEqualTo(person.getId());
    verify(DAO).findById(1L);
}
Also used : Person(com.example.helloworld.core.Person) Test(org.junit.Test)

Aggregations

Person (com.example.helloworld.core.Person)7 Test (org.junit.Test)5 Before (org.junit.Before)2 Response (javax.ws.rs.core.Response)1