### Question:
AssetRenditionsZipperImpl implements AssetRenditionsDownloadOrchestrator { protected String getFileName(final ValueMap properties) { String fileName = properties.get(PN_FILE_NAME, StringUtils.defaultString(cfg.file_name(), DEFAULT_FILE_ATTACHMENT_NAME)); if (!StringUtils.endsWith(fileName, ZIP_EXTENSION)) { fileName += ZIP_EXTENSION; } return fileName; }  @Override void execute(final SlingHttpServletRequest request,
                        final SlingHttpServletResponse response,
                        final List<AssetModel> assets,
                        final List<String> renditionNames); @Override boolean accepts(SlingHttpServletRequest request, List<AssetModel> assets, List<String> renditionNames); static final String NAME; static final String VAR_ASSET_NAME; static final String VAR_ASSET_EXTENSION; static final String VAR_RENDITION_NAME; static final String VAR_RENDITION_EXTENSION; static final String VAR_ASSET_FILE_NAME; static final String VAR_ASSET_TITLE; static final String ZIP_EXTENSION; static final String DEFAULT_NO_CONTENT_FILE_NAME; static final String DEFAULT_NO_CONTENT_MESSAGE; }### Answer:
@Test public void getFileName_FromResource() { final String expected = "My Assets.zip"; ctx.registerInjectActivateService(new AssetRenditionsZipperImpl(), "file.name", "OSGi value"); AssetRenditionsZipperImpl zipper = (AssetRenditionsZipperImpl) ctx.getService(AssetRenditionsDownloadOrchestrator.class); assertEquals(expected, zipper.getFileName(new ValueMapDecorator(ImmutableMap.of("fileName", "My Assets")))); }
@Test public void getFileName_FromOSGiConfig() { final String expected = "Test Assets.zip"; ctx.registerInjectActivateService(new AssetRenditionsZipperImpl(), "file.name", expected); AssetRenditionsZipperImpl zipper = (AssetRenditionsZipperImpl) ctx.getService(AssetRenditionsDownloadOrchestrator.class); assertEquals(expected, zipper.getFileName(new ValueMapDecorator(Collections.emptyMap()))); }
@Test public void getFileName_Default() { final String expected = "Assets.zip"; ctx.registerInjectActivateService(new AssetRenditionsZipperImpl()); AssetRenditionsZipperImpl zipper = (AssetRenditionsZipperImpl) ctx.getService(AssetRenditionsDownloadOrchestrator.class); assertEquals(expected, zipper.getFileName(new ValueMapDecorator(Collections.emptyMap()))); }