### Question:
AwsS3DistributionServiceImpl extends AbstractDistributionService implements AwsS3DistributionService, DistributionService { public MediaPackageElement distributeElement(String channelId, final MediaPackage mediaPackage, MediaPackageElement element, boolean checkAvailability) throws DistributionException { notNull(channelId, "channelId"); notNull(mediaPackage, "mediapackage"); notNull(element, "element"); try { return distributeElement(channelId, mediaPackage, element, checkAvailability, workspace.get(element.getURI())); } catch (NotFoundException e) { throw new DistributionException("Unable to find " + element.getURI() + " in the workspace", e); } catch (IOException e) { throw new DistributionException("Error loading " + element.getURI() + " from the workspace", e); } } AwsS3DistributionServiceImpl(); @Override void activate(ComponentContext cc); @Override String getDistributionType(); void deactivate(); @Override Job distribute(String pubChannelId, MediaPackage mediaPackage, Set<String> downloadIds,
    boolean checkAvailability, boolean preserveReference); @Override Job distribute(String channelId, MediaPackage mediaPackage, Set<String> elementIds, boolean checkAvailability); @Override Job distribute(String channelId, MediaPackage mediapackage, String elementId); @Override Job distribute(String channelId, MediaPackage mediaPackage, String elementId, boolean checkAvailability); MediaPackageElement[] distributeElements(String channelId, MediaPackage mediapackage, Set<String> elementIds,
          boolean checkAvailability); MediaPackageElement distributeElement(String channelId, final MediaPackage mediaPackage,
          MediaPackageElement element, boolean checkAvailability); @Override Job retract(String channelId, MediaPackage mediapackage, String elementId); @Override Job retract(String channelId, MediaPackage mediapackage, Set<String> elementIds); @Override List<MediaPackageElement> distributeSync(String channelId, MediaPackage mediapackage, Set<String> elementIds,
         boolean checkAvailability); @Override List<MediaPackageElement> retractSync(String channelId, MediaPackage mediaPackage, Set<String> elementIds); @Override Job restore(String channelId, MediaPackage mediaPackage, String elementId); @Override Job restore(String channelId, MediaPackage mediaPackage, String elementId, String fileName); static final String JOB_TYPE; static final String AWS_S3_DISTRIBUTION_ENABLE; static final String AWS_S3_DISTRIBUTION_BASE_CONFIG; static final String AWS_S3_ACCESS_KEY_ID_CONFIG; static final String AWS_S3_SECRET_ACCESS_KEY_CONFIG; static final String AWS_S3_REGION_CONFIG; static final String AWS_S3_BUCKET_CONFIG; static final String AWS_S3_ENDPOINT_CONFIG; static final String AWS_S3_PATH_STYLE_CONFIG; static final String OPENCAST_DOWNLOAD_URL; static final String OPENCAST_STORAGE_DIR; static final String DEFAULT_TEMP_DIR; static final float DEFAULT_DISTRIBUTE_JOB_LOAD; static final float DEFAULT_RETRACT_JOB_LOAD; static final float DEFAULT_RESTORE_JOB_LOAD; static final String DISTRIBUTE_JOB_LOAD_KEY; static final String RETRACT_JOB_LOAD_KEY; static final String RESTORE_JOB_LOAD_KEY; }### Answer:
@Test public void testDistributeElement() throws Exception { Upload upload = EasyMock.createNiceMock(Upload.class); EasyMock.expect( tm.upload(EasyMock.anyObject(String.class), EasyMock.anyObject(String.class), EasyMock.anyObject(File.class))).andReturn( upload); EasyMock.replay(upload, tm); Set<String> mpeIds = new LinkedHashSet<String>(); mpeIds.add("presenter-delivery"); MediaPackageElement[] mpes = service.distributeElements("channelId", mp, mpeIds, false); MediaPackageElement mpe = mpes[0]; Assert.assertEquals(new URI( "http: mpe.getURI()); }