@Test public void isLegacyMode_No_WithGroups() { ctx.currentResource("/content/download_with_asset_rendition_groups"); final Options group1Options = new TestOptionsImpl(ctx.currentResource().getChild("asset-renditions-groups/items/item0/asset-renditions/items")); final Options group2Options = new TestOptionsImpl(ctx.currentResource().getChild("asset-renditions-groups/items/item1/asset-renditions/items")); doReturn(group1Options).when(modelFactory).getModelFromWrappedRequest(eq(ctx.request()), argThat(new IsSameResourceByPath(ctx.currentResource().getChild("asset-renditions-groups/items/item0/asset-renditions").getPath())), eq(Options.class)); doReturn(group2Options).when(modelFactory).getModelFromWrappedRequest(eq(ctx.request()), argThat(new IsSameResourceByPath(ctx.currentResource().getChild("asset-renditions-groups/items/item1/asset-renditions").getPath())), eq(Options.class)); final Download download = ctx.request().adaptTo(Download.class); assertFalse("Should be NOT be legacy mode", ((DownloadImpl)download).isLegacyMode()); }
@Deprecated protected boolean isLegacyMode() { if (legacyMode == null) { if (getAssetRenditionsGroups() != null && !getAssetRenditionsGroups().isEmpty()) { return false; } else { return excludeOriginalAssets != null; } } else { return legacyMode; } }
DownloadImpl implements Download, ComponentExporter { @Deprecated protected boolean isLegacyMode() { if (legacyMode == null) { if (getAssetRenditionsGroups() != null && !getAssetRenditionsGroups().isEmpty()) { return false; } else { return excludeOriginalAssets != null; } } else { return legacyMode; } } }
DownloadImpl implements Download, ComponentExporter { @Deprecated protected boolean isLegacyMode() { if (legacyMode == null) { if (getAssetRenditionsGroups() != null && !getAssetRenditionsGroups().isEmpty()) { return false; } else { return excludeOriginalAssets != null; } } else { return legacyMode; } }  }
DownloadImpl implements Download, ComponentExporter { @Deprecated protected boolean isLegacyMode() { if (legacyMode == null) { if (getAssetRenditionsGroups() != null && !getAssetRenditionsGroups().isEmpty()) { return false; } else { return excludeOriginalAssets != null; } } else { return legacyMode; } }  @Override List<AssetRenditionsGroup> getAssetRenditionsGroups(); Collection<AssetModel> getAssets(); String getZipFileName(); @Override long getMaxContentSize(); @Override long getDownloadContentSize(); @Override String getMaxContentSizeLabel(); @Override String getDownloadContentSizeLabel(); @Nonnull @Override String getExportedType(); }
DownloadImpl implements Download, ComponentExporter { @Deprecated protected boolean isLegacyMode() { if (legacyMode == null) { if (getAssetRenditionsGroups() != null && !getAssetRenditionsGroups().isEmpty()) { return false; } else { return excludeOriginalAssets != null; } } else { return legacyMode; } }  @Override List<AssetRenditionsGroup> getAssetRenditionsGroups(); Collection<AssetModel> getAssets(); String getZipFileName(); @Override long getMaxContentSize(); @Override long getDownloadContentSize(); @Override String getMaxContentSizeLabel(); @Override String getDownloadContentSizeLabel(); @Nonnull @Override String getExportedType(); static final String PN_ASSET_RENDITIONS_GROUP_TITLE; static final String NN_ASSET_RENDITIONS; static final String NN_ITEMS; }