    @Test
    public void shouldApplyUpdate_withDatabaseTemplate() throws Throwable {

        // Given
        final StubItem item = new StubItem();
        final Long itemVersion = randomLong();
        final List<PersistenceExceptionHandler<?>> persistenceExceptionHandlers = Collections.EMPTY_LIST;
        final UpdateAction<StubItem> updateAction = new UpdateAction<>(item, persistenceExceptionHandlers);
        final DatabaseTemplate mockDatabaseTemplate = mock(DatabaseTemplate.class);

        item.setVersion(itemVersion);

        // When
        updateAction.apply(mockDatabaseTemplate);

        // Then
        verify(mockDatabaseTemplate).update(item);

        assertThat(item.getVersion(), is(itemVersion - 1));
    }