package com.photon.phresco.servlets;
import static org.junit.Assert.assertNotNull;
import java.lang.reflect.Type;
import java.util.List;
import org.junit.Test;
import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.photon.phresco.exception.PhrescoException;
import com.photon.phresco.model.VideoInfo;
import com.photon.phresco.service.api.PhrescoServerFactory;
import com.photon.phresco.service.api.RepositoryManager;
import com.photon.phresco.service.util.ServerConstants;
public class VideoDownloaderTest {
@Test
public void testVideoDownloader() throws PhrescoException {
PhrescoServerFactory.initialize();
Gson gson = new Gson();
RepositoryManager repoMgr = PhrescoServerFactory.getRepositoryManager();
String videoInfoJSON = repoMgr.getArtifactAsString(ServerConstants.HOMEPAGE_JSON_FILE);
Type type = new TypeToken<List<VideoInfo>>() {
}.getType();
List<VideoInfo> videoInfoList = gson.fromJson(videoInfoJSON, type);
assertNotNull(videoInfoList);
}
}