@Test
  public void testBadJsonFile() throws Exception {
    String badJsonFile = tempDirPath + File.separator + "badJsonFile.json";
    writeStringToFile("Invalid json string", badJsonFile);
    try (AccountService accountService = AccountUpdateTool.getHelixAccountService(ZK_SERVER_ADDRESS,
        HELIX_STORE_ROOT_PATH, BACKUP_DIR, ZK_CONNECTION_TIMEOUT_MS, ZK_SESSION_TIMEOUT_MS)) {
      new AccountUpdateTool(accountService, Container.getCurrentJsonVersion()).updateAccountsFromFile(badJsonFile,
          false);
      fail("Should have thrown.");
    } catch (Exception e) {
      // expected
    }
    Thread.sleep(100);
    assertEquals("Wrong number of accounts in accountService", 0, accountService.getAllAccounts().size());
  }
Tests creating/updating {@link Account}s using bad file containing no valid json array.
@throws Exception Any unexpected exception.
ambry-tools/src/integration-test/java/com/github/ambry/account/AccountUpdateToolTest.java