VpcRouterDeploymentDefinition extends RouterDeploymentDefinition { @Override protected void unlock() { if (tableLockId != null) { vpcDao.releaseFromLockTable(tableLockId); if (logger.isDebugEnabled()) { logger.debug("Lock is released for vpc id " + tableLockId + " as a part of router startup in " + dest); } } } protected  VpcRouterDeploymentDefinition(final Network guestNetwork, final Vpc vpc, final DeployDestination dest, final Account owner,
            final Map<Param, Object> params); @Override Vpc getVpc(); @Override boolean isVpcRouter(); @Override boolean needsPublicNic(); @Override boolean hasSourceNatService(); @Override void generateDeploymentPlan(); @Override boolean isRedundant();  }
@Test public void testUnlock() { deployment.tableLockId = VPC_ID; deployment.unlock(); verify(mockVpcDao, times(1)).releaseFromLockTable(VPC_ID); }
@Test public void testUnlockWithoutLock() { deployment.tableLockId = null; deployment.unlock(); verify(mockVpcDao, times(0)).releaseFromLockTable(anyLong()); }