@Test public void shouldNotAcceptNullPreparationId() throws Exception { final ExportParameters parameters = new ExportParameters(); parameters.setContent(new DataSet()); parameters.setPreparationId(null); assertFalse(cachedExportStrategy.test(parameters)); }
@Override public boolean test(ExportParameters parameters) { if (parameters == null) { return false; } if (parameters.getContent() != null) { return false; } if (StringUtils.isEmpty(parameters.getPreparationId())) { return false; } try { final TransformationCacheKey contentKey = getCacheKey(parameters); return contentCache.has(contentKey); } catch (TDPException e) { LOGGER.debug("Unable to use cached export strategy.", e); return false; } }
CachedExportStrategy extends BaseSampleExportStrategy { @Override public boolean test(ExportParameters parameters) { if (parameters == null) { return false; } if (parameters.getContent() != null) { return false; } if (StringUtils.isEmpty(parameters.getPreparationId())) { return false; } try { final TransformationCacheKey contentKey = getCacheKey(parameters); return contentCache.has(contentKey); } catch (TDPException e) { LOGGER.debug("Unable to use cached export strategy.", e); return false; } } }
CachedExportStrategy extends BaseSampleExportStrategy { @Override public boolean test(ExportParameters parameters) { if (parameters == null) { return false; } if (parameters.getContent() != null) { return false; } if (StringUtils.isEmpty(parameters.getPreparationId())) { return false; } try { final TransformationCacheKey contentKey = getCacheKey(parameters); return contentCache.has(contentKey); } catch (TDPException e) { LOGGER.debug("Unable to use cached export strategy.", e); return false; } }  }
CachedExportStrategy extends BaseSampleExportStrategy { @Override public boolean test(ExportParameters parameters) { if (parameters == null) { return false; } if (parameters.getContent() != null) { return false; } if (StringUtils.isEmpty(parameters.getPreparationId())) { return false; } try { final TransformationCacheKey contentKey = getCacheKey(parameters); return contentCache.has(contentKey); } catch (TDPException e) { LOGGER.debug("Unable to use cached export strategy.", e); return false; } }  @Override boolean test(ExportParameters parameters); @Override StreamingResponseBody execute(ExportParameters parameters); }
CachedExportStrategy extends BaseSampleExportStrategy { @Override public boolean test(ExportParameters parameters) { if (parameters == null) { return false; } if (parameters.getContent() != null) { return false; } if (StringUtils.isEmpty(parameters.getPreparationId())) { return false; } try { final TransformationCacheKey contentKey = getCacheKey(parameters); return contentCache.has(contentKey); } catch (TDPException e) { LOGGER.debug("Unable to use cached export strategy.", e); return false; } }  @Override boolean test(ExportParameters parameters); @Override StreamingResponseBody execute(ExportParameters parameters);  }