### Question:
TransactionalDatabaseTemplate implements DatabaseTemplate, TransactionalResource { @Override public <T extends Item> T read(final ItemId itemId, final Class<T> itemClass) throws NonExistentItemException { return databaseTemplate.read(itemId, itemClass); } TransactionalDatabaseTemplate(final DatabaseTemplate databaseTemplate); @Override void begin(); @Override void commit(); @Override T create(final T item, final PersistenceExceptionHandler<?>... persistenceExceptionHandlers); @Override T update(final T item, final PersistenceExceptionHandler<?>... persistenceExceptionHandlers); @Override void delete(final Item item, final PersistenceExceptionHandler<?>... persistenceExceptionHandlers); @Override T read(final ItemId itemId, final Class<T> itemClass); @Override Collection<T> fetch(final Query query, final Class<T> itemClass); @Override T fetchUnique(final Query query, final Class<T> itemClass); @Override GeneratedKeyHolder generateKeys(final SequenceKeyGenerator sequenceKeyGenerator); @Override void abort();  }### Answer:
@Test public void shouldRead_withItemIdAndItemClass() throws Exception { final ItemId itemId = mock(ItemId.class); final StubItem mockItem = mock(StubItem.class); when(mockDatabaseTemplate.read(any(ItemId.class), any(Class.class))).thenReturn(mockItem); final TransactionalDatabaseTemplate transactionalDatabaseTemplate = new TransactionalDatabaseTemplate( mockDatabaseTemplate); final StubItem item = transactionalDatabaseTemplate.read(itemId, StubItem.class); verify(mockDatabaseTemplate).read(itemId, StubItem.class); assertEquals(mockItem, item); }