// upload the encrypted file to the server.
uploadEncryptedAssetFile(assetInfo, blobWriter, "MPEG4-H264.mp4",
encryptedContent, contentKeyId, iv);
// submit and execute the decoding job.
JobInfo jobInfo = decodeAsset(testJobPrefix
+ "uploadAesProtectedAssetSuccess", assetInfo.getId());
// assert
LinkInfo<TaskInfo> taskLinkInfo = jobInfo.getTasksLink();
List<TaskInfo> taskInfos = service.list(Task.list(taskLinkInfo));
for (TaskInfo taskInfo : taskInfos) {
assertEquals(TaskState.Completed, taskInfo.getState());
ListResult<AssetInfo> outputs = service.list(Asset.list(taskInfo
.getOutputAssetsLink()));
assertEquals(1, outputs.size());
}
assertEquals(JobState.Finished, jobInfo.getState());
// Verify that the contents match
InputStream expected = getClass().getResourceAsStream(
"/media/MPEG4-H264.mp4");
ListResult<AssetInfo> outputAssets = service.list(Asset.list(jobInfo
.getOutputAssetsLink()));
assertEquals(1, outputAssets.size());
AssetInfo outputAsset = outputAssets.get(0);
ListResult<AssetFileInfo> assetFiles = service.list(AssetFile
.list(assetInfo.getAssetFilesLink()));