@Test
public void testParseMetadataSuccess() {

  Path jobFolder = new Path(Constants.TONY_CORE_SRC + "test/resources/typicalHistFolder/job1");
  String jobRegex = "application\\d+";
  JobMetadata expected = new JobMetadata.Builder()
      .setId("application123")
      .setConf(yarnConf)
      .setStarted(1)
      .setCompleted(1)
      .setStatus(Constants.SUCCEEDED)
      .setUser("user1")
      .build();
  JobMetadata actual = ParserUtils.parseMetadata(fs, yarnConf, jobFolder, jobRegex);
  assertEquals(actual.getId(), expected.getId());
  assertEquals(actual.getJobLink(), expected.getJobLink());
  assertEquals(actual.getConfigLink(), expected.getConfigLink());
  assertEquals(actual.getRMLink(), expected.getRMLink());
  assertEquals(actual.getStartedDate(), expected.getStartedDate());
  assertEquals(actual.getCompletedDate(), expected.getCompletedDate());
  assertEquals(actual.getStatus(), expected.getStatus());
  assertEquals(actual.getUser(), expected.getUser());
}