use of org.talend.dataprep.api.export.ExportParameters in project data-prep by Talend.
the class ApplyPreparationExportStrategyTest method shouldAcceptIfDataSetAndPreparationParametersSet.
@Test
public void shouldAcceptIfDataSetAndPreparationParametersSet() throws Exception {
// Given
final ExportParameters parameters = new ExportParameters();
parameters.setDatasetId("1234");
parameters.setPreparationId("1234");
// Then
assertTrue(applyPreparationExportStrategy.accept(parameters));
}
use of org.talend.dataprep.api.export.ExportParameters in project data-prep by Talend.
the class ApplyPreparationExportStrategyTest method shouldNotAcceptIfDataSetParameterNotSet.
@Test
public void shouldNotAcceptIfDataSetParameterNotSet() throws Exception {
// Given
final ExportParameters parameters = new ExportParameters();
parameters.setDatasetId("");
parameters.setPreparationId("1234");
parameters.setStepId("0");
parameters.setExportType("text");
parameters.setFrom(ExportParameters.SourceType.HEAD);
// Then
assertFalse(applyPreparationExportStrategy.accept(parameters));
}
use of org.talend.dataprep.api.export.ExportParameters in project data-prep by Talend.
the class CachedExportStrategyTest method shouldNotAcceptNullPreparationId.
@Test
public void shouldNotAcceptNullPreparationId() throws Exception {
// Then
final ExportParameters parameters = new ExportParameters();
parameters.setContent(new DataSet());
parameters.setPreparationId(null);
assertFalse(cachedExportStrategy.accept(parameters));
}
use of org.talend.dataprep.api.export.ExportParameters in project data-prep by Talend.
the class CachedExportStrategyTest method shouldAcceptIfCacheEntryExists.
@Test
public void shouldAcceptIfCacheEntryExists() throws Exception {
// Given
final ExportParameters parameters = new ExportParameters();
parameters.setDatasetId("1234");
parameters.setPreparationId("1234");
parameters.setStepId("0");
parameters.setExportType("text");
parameters.setFrom(HEAD);
// Then
assertTrue(cachedExportStrategy.accept(parameters));
}
use of org.talend.dataprep.api.export.ExportParameters in project data-prep by Talend.
the class CachedExportStrategyTest method shouldNotAcceptIfCacheEntryDoesNotExists.
@Test
public void shouldNotAcceptIfCacheEntryDoesNotExists() throws Exception {
// Given
final ExportParameters parameters = new ExportParameters();
parameters.setDatasetId("1234");
// Preparation differs from key.
parameters.setPreparationId("2345");
parameters.setStepId("0");
parameters.setExportType("text");
parameters.setFrom(HEAD);
// Then
assertFalse(cachedExportStrategy.accept(parameters));
}
Aggregations