### Question:
InterfaceDaoInvoker implements DaoInvoker { public Object lookup(final String name, final Object ... parameters) { if(finderDAO == null) { throw new UnsupportedOperationException("The DAO '" + dao.getClass().getName() + "' doesn't implement the '" + Locator.class.getName() + "' interface and there for can't find by query."); } return finderDAO.lookup(name, parameters); } @SuppressWarnings("unchecked")  InterfaceDaoInvoker(final Object dao); Object insert(final Object obj); Object insert(String name, Object obj); Object update(final Object obj); Object update(String name, Object obj); Object delete(Object entity); Object delete(String name, Object entity); void flush(); Object lookupByQuery(final String query, final Object ... parameters); Object lookupByQuery(final String query, final Map<String, ?> parameters); Object lookup(final String name, final Object ... parameters); Object lookup(final String name, final Map<String, ?> parameters);  }### Answer:
@Test public void test_lookup() { DaoInvoker invoker = new InterfaceDaoInvoker(fullDao); Map<String, Object> params = new HashMap<String, Object>(); invoker.lookup("id", params); verify(fullDao).lookup(eq("id"), same(params)); }
@Test(expectedExceptions = UnsupportedOperationException.class) public void test_findBy_non_finder_dao() { DaoInvoker invoker = new InterfaceDaoInvoker(minimumDao); Map<String, Object> params = new HashMap<String, Object>(); invoker.lookup("id", params); }