PreparationExportStrategy extends BaseSampleExportStrategy { @Override public boolean test(final ExportParameters parameters) { if (parameters == null) { return false; } return parameters.getContent() == null && (parameters.getFrom() == null || parameters.getFrom() == HEAD) && !StringUtils.isEmpty(parameters.getPreparationId()) && StringUtils.isEmpty(parameters.getDatasetId()); }  @Override boolean test(final ExportParameters parameters); @Override StreamingResponseBody execute(final ExportParameters parameters); void performPreparation(final ExportParameters parameters, final OutputStream outputStream);  }
@Test public void shouldNotAcceptNullParameters() { assertFalse(strategy.test(null)); }
@Test public void shouldAcceptParameters() { final ExportParameters parameters = new ExportParameters(); parameters.setContent(null); parameters.setFrom(null); parameters.setFrom(ExportParameters.SourceType.HEAD); parameters.setPreparationId("prep-1234"); parameters.setDatasetId(""); assertTrue(strategy.test(parameters)); }