@Override protected PersonAttribute getExistingObject() { return personService.getPersonAttribute(EXISTING_ID); } }
@Override protected PersonAttribute getObjectById(Integer id) { return Context.getPersonService().getPersonAttribute(id); }
/** * @see PersonService#getPersonAttribute(Integer) */ @Test public void getPersonAttribute_shouldReturnPersonAttributeWhenGivenIdDoesExist() throws Exception { PersonAttribute personAttribute = Context.getPersonService().getPersonAttribute(17); Assert.assertNotNull(personAttribute); assertTrue("Expecting the return is of a person attribute", personAttribute.getClass().equals( PersonAttribute.class)); }
/** * @see PersonService#getPersonAttribute(Integer) */ @Test public void getPersonAttribute_shouldReturnNullWhenGivenIdDoesNotExist() throws Exception { PersonAttribute personAttribute = Context.getPersonService().getPersonAttribute(10000); Assert.assertNull(personAttribute); }