### Question:
DAOTicketImpl extends AbstractDAO<TicketEntity, JPATicketEntity> implements DAOTicket { @Override public UID getObjectEntityUID(String ticketUID) throws NoResultException { JPATicketEntity ticket = this.queryTicket().uid.eq(ticketUID).findOne(); if (ticket == null) { throw new NoResultException(); } return ticket.getObjectUID(); }  @Override TicketEntity getEntityInstance(); @Override UID getObjectEntityUID(String ticketUID);  }### Answer:
@Test public void getObjectEntityUID_noTickets() { this.expectedException.expect(NoResultException.class); DAOTicketImplTest.daoTicketImpl.getObjectEntityUID(DAOTicketImplTest.rightTicketUid.toString()); }
@Test public void getObjectEntityUID_noSuchUID() { Ebean.beginTransaction(); JPATicketEntity ticket = new JPATicketEntity(); ticket.setUID(DAOTicketImplTest.rightTicketUid); ticket.setObjectUID(DAOTicketImplTest.referencedObjUid); DAOTicketImplTest.daoTicketImpl.create(ticket); Ebean.commitTransaction(); this.expectedException.expect(NoResultException.class); DAOTicketImplTest.daoTicketImpl.getObjectEntityUID(DAOTicketImplTest.wrongTicketUid.toString()); }
@Test public void getObjectEntityUID() { Ebean.beginTransaction(); JPATicketEntity ticket = new JPATicketEntity(); ticket.setUID(DAOTicketImplTest.rightTicketUid); ticket.setObjectUID(DAOTicketImplTest.referencedObjUid); DAOTicketImplTest.daoTicketImpl.create(ticket); Ebean.commitTransaction(); UID objUid = DAOTicketImplTest.daoTicketImpl.getObjectEntityUID(DAOTicketImplTest.rightTicketUid.toString()); Assert.assertEquals(objUid, DAOTicketImplTest.referencedObjUid); }