### Question:
FactRequestResolver { public FactRecord resolveFact(UUID id) throws ObjectNotFoundException { FactRecord record = objectFactDao.getFact(id); if (record == null) { throw new ObjectNotFoundException(String.format("Fact with id = %s does not exist.", id), "fact.not.exist", "id", ObjectUtils.ifNotNull(id, Object::toString, "NULL")); } return record; } @Inject  FactRequestResolver(ObjectFactDao objectFactDao); FactRecord resolveFact(UUID id);  }### Answer:
@Test(expected = ObjectNotFoundException.class) public void testResolveFactWithNull() throws Exception { resolver.resolveFact(null); }
@Test(expected = ObjectNotFoundException.class) public void testResolveFactNotFound() throws Exception { resolver.resolveFact(UUID.randomUUID()); }
@Test public void testResolveFactFound() throws Exception { FactRecord fact = new FactRecord().setId(UUID.randomUUID()); when(objectFactDao.getFact(fact.getId())).thenReturn(fact); assertSame(fact, resolver.resolveFact(fact.getId())); verify(objectFactDao).getFact(fact.getId()); }