@Test
public void testPreCommitChangedVetoThrowsException() throws SubSystemValidationException, NetconfMessageBuilderException {

    RequestScope.getCurrentScope().putInCache(RequestTask.CURRENT_REQ, m_request);
    doThrow(new SubSystemValidationException("Veto threw exception")).when(m_deviceInterface).veto(eq(m_device), eq(m_request),
            m_updatedDsCaptor.capture(), m_oldDsCaptor.capture());
    try {
        m_deviceSubsystem.notifyPreCommitChange(m_changeNotifications);
        assertEquals(UPDATED_DS, DocumentUtils.documentToPrettyString(m_updatedDsCaptor.getValue()).trim());
        assertEquals(OLD_DS, DocumentUtils.documentToPrettyString(m_oldDsCaptor.getValue()).trim());
        fail("Should have failed");
    } catch (SubSystemValidationException e) {
        assertEquals("Veto threw exception", e.getMessage());
        verify(m_deviceStore).setDeviceXml(OLD_DS);
    }
}