@Test
public void testGenerateFileNameFinishedJob() {

  String appId = "app123";
  long started = 1L;
  long completed = 2L;
  String user = "user";
  JobMetadata metadata = new JobMetadata.Builder()
      .setId(appId)
      .setStarted(started)
      .setCompleted(completed)
      .setUser(user)
      .setStatus(Constants.SUCCEEDED)
      .setConf(new YarnConfiguration())
      .build();
  String expectedName = "app123-1-2-user-SUCCEEDED." + Constants.HISTFILE_SUFFIX;
  assertEquals(HistoryFileUtils.generateFileName(metadata), expectedName);
}