@Test public void isValidAssetRenditionName() { AssetRenditionDispatcher one = new InternalRedirectRenditionDispatcherImpl(); ctx.registerInjectActivateService(one, Constants.SERVICE_RANKING, 80, "rendition.mappings", "test-rendition=im real"); final AssetRenditionDispatchers assetRenditionDispatchers = ctx.getService(AssetRenditionDispatchers.class); assertTrue(assetRenditionDispatchers.isValidAssetRenditionName("test-rendition")); assertFalse(assetRenditionDispatchers.isValidAssetRenditionName("fake-rendition-name")); }
@Override public boolean isValidAssetRenditionName(final String name) { final Optional<AssetRenditionDispatcher> found = getAssetRenditionDispatchers().stream() .filter(dispatcher -> dispatcher.getRenditionNames().contains(name)) .findAny(); return found.isPresent(); }
AssetRenditionDispatchersImpl implements AssetRenditionDispatchers { @Override public boolean isValidAssetRenditionName(final String name) { final Optional<AssetRenditionDispatcher> found = getAssetRenditionDispatchers().stream() .filter(dispatcher -> dispatcher.getRenditionNames().contains(name)) .findAny(); return found.isPresent(); } }
AssetRenditionDispatchersImpl implements AssetRenditionDispatchers { @Override public boolean isValidAssetRenditionName(final String name) { final Optional<AssetRenditionDispatcher> found = getAssetRenditionDispatchers().stream() .filter(dispatcher -> dispatcher.getRenditionNames().contains(name)) .findAny(); return found.isPresent(); }  }
AssetRenditionDispatchersImpl implements AssetRenditionDispatchers { @Override public boolean isValidAssetRenditionName(final String name) { final Optional<AssetRenditionDispatcher> found = getAssetRenditionDispatchers().stream() .filter(dispatcher -> dispatcher.getRenditionNames().contains(name)) .findAny(); return found.isPresent(); }  @Override List<AssetRenditionDispatcher> getAssetRenditionDispatchers(); @Override boolean isValidAssetRenditionName(final String name); }
AssetRenditionDispatchersImpl implements AssetRenditionDispatchers { @Override public boolean isValidAssetRenditionName(final String name) { final Optional<AssetRenditionDispatcher> found = getAssetRenditionDispatchers().stream() .filter(dispatcher -> dispatcher.getRenditionNames().contains(name)) .findAny(); return found.isPresent(); }  @Override List<AssetRenditionDispatcher> getAssetRenditionDispatchers(); @Override boolean isValidAssetRenditionName(final String name);  }