@Test
  public void testUpdateAccountsWithVersionMismatchIgnored() throws Exception {

    mySqlConfigProps.setProperty(IGNORE_VERSION_MISMATCH, "true");
    AccountService mySqlAccountService = getAccountService();

    // write account (1, "a")
    Account accountToUpdate = new AccountBuilder((short) 1, "a", Account.AccountStatus.ACTIVE).addOrUpdateContainer(
        new ContainerBuilder((short) 1, "c1", Container.ContainerStatus.ACTIVE, "c1", (short) 1).build()).build();
    mySqlAccountService.updateAccounts(Collections.singletonList(accountToUpdate));

    // verify updating account (1, "a") with different version is successful
    accountToUpdate = new AccountBuilder(accountToUpdate).status(Account.AccountStatus.INACTIVE)
        .snapshotVersion(mySqlAccountService.getAccountById((short) 1).getSnapshotVersion() + 5)
        .build();
    mySqlAccountService.updateAccounts(Collections.singletonList(accountToUpdate));
    assertEquals("Mismatch in account information", accountToUpdate, mySqlAccountService.getAccountById((short) 1));

    // verify updating container (1,"c1") in account (1,"a") with different version is successful
    Container containerToUpdate = accountToUpdate.getContainerById((short) 1);
    containerToUpdate = new ContainerBuilder(containerToUpdate).setStatus(Container.ContainerStatus.INACTIVE)
        .setSnapshotVersion(containerToUpdate.getSnapshotVersion() + 5)
        .build();
    mySqlAccountService.updateContainers(accountToUpdate.getName(), Collections.singletonList(containerToUpdate));
    assertEquals("Mismatch in container information", containerToUpdate,
        mySqlAccountService.getContainerByName(accountToUpdate.getName(), containerToUpdate.getName()));
  }
Tests ignoring version conflicts in Accounts and Containers
ambry-account/src/test/java/com/github/ambry/account/MySqlAccountServiceTest.java