@Test
public void testLoadUpgradeStatus()
{

    String upgradeStatusFileName = null;
    assertNull( HmsUpgradeUtil.loadUpgradeStatus( upgradeStatusFileName ) );
    Calendar cal = Calendar.getInstance();
    String timeInMillis = Long.toString( cal.getTimeInMillis() );
    String id = UUID.randomUUID().toString();
    UpgradeStatusCode statusCode = UpgradeStatusCode.HMS_UPGRADE_INITIATED;
    UpgradeStatus upgradeStatus = new UpgradeStatus();
    upgradeStatus.setId( id );
    upgradeStatus.setStatusCode( statusCode );
    upgradeStatusFileName = upgradeDir + File.separator + timeInMillis + ".json";
    assertTrue( HmsUpgradeUtil.saveUpgradeStatus( upgradeStatusFileName, upgradeStatus ) );
    File upgradeStatusFile = new File( upgradeStatusFileName );
    assertTrue( upgradeStatusFile.exists() && upgradeStatusFile.isFile() );
    UpgradeStatus status = HmsUpgradeUtil.loadUpgradeStatus( upgradeStatusFileName );
    assertNotNull( status );
    assertEquals( status.getId(), upgradeStatus.getId() );
    assertEquals( status.getStatusCode(), upgradeStatus.getStatusCode() );
    assertTrue( upgradeStatusFile.delete() );
    File upgradeDirFile = new File( upgradeDir );
    if ( upgradeDirFile.exists() && upgradeDirFile.isDirectory() )
    {
        upgradeDirFile.delete();
    }
}