@Test
public void testCreateInventoryFile()
    throws HmsException
{

    Map<String, Object[]> inventory = new HashMap<String, Object[]>();
    String nodeId = "N" + TestUtil.getDateTimeStamp();
    ServerNode serverNode = TestUtil.getServerNode( nodeId );
    List<ServerNode> serverNodes = new ArrayList<ServerNode>();
    serverNodes.add( serverNode );
    inventory.put( Constants.HOSTS, serverNodes.toArray( new ServerNode[serverNodes.size()] ) );
    String tempDir = TestUtil.getTemporaryDirectory();
    String invFileName = FilenameUtils.concat( tempDir, TestUtil.getDateTimeStamp() + ".json" );
    String invContent = TestUtil.getValueAsString( inventory );
    boolean createdOrUpdated = InventoryUtil.createOrUpdateInventoryFile( invFileName, invContent );
    assertTrue( createdOrUpdated );
    assertTrue( FileUtil.deleteDirectory( tempDir ) );
}