@Test(expected = ConcurrentOperationException.class)
public void testDeployVirtualRouter() throws ConcurrentOperationException,
InsufficientCapacityException, ResourceUnavailableException {

    // Prepare
    final List<DeployDestination> mockDestinations = new ArrayList<>();
    mockDestinations.add(mock(DeployDestination.class));
    mockDestinations.add(mock(DeployDestination.class));
    final RouterDeploymentDefinition deploymentUT = spy(deployment);
    doNothing().when(deploymentUT).lock();
    doNothing().when(deploymentUT).checkPreconditions();
    doReturn(mockDestinations).when(deploymentUT).findDestinations();
    doNothing().when(deploymentUT).planDeploymentRouters();
    doNothing().when(deploymentUT).generateDeploymentPlan();
    // Let's test that if the last step fails in the last iteration it unlocks the table
    final ConcurrentOperationException exception =
            new ConcurrentOperationException(null);
    doNothing().doThrow(exception).when(deploymentUT).executeDeployment();
    doNothing().when(deploymentUT).unlock();
    // Execute
    try {
        deploymentUT.findOrDeployVirtualRouter();
    } finally {
        // Assert
        verify(deploymentUT, times(1)).lock();
        verify(deploymentUT, times(2)).checkPreconditions();
        verify(deploymentUT, times(2)).findDestinations();
        verify(deploymentUT, times(3)).generateDeploymentPlan();
        verify(deploymentUT, times(2)).executeDeployment();
        //verify(deploymentUT, times(2)).planDeploymentRouters();
        verify(deploymentUT, times(1)).unlock();
    }
    fail();
}