com.smartbear.readyapi.client.teststeps.datasource.ExcelDataSourceBuilder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ready-api-testserver-client Show documentation
Show all versions of ready-api-testserver-client Show documentation
Java client library for creating and executing test recipes against Ready!API TestServer
The newest version!
package com.smartbear.readyapi.client.teststeps.datasource;
import com.smartbear.readyapi.client.model.DataSource;
import com.smartbear.readyapi.client.model.ExcelDataSource;
import java.util.ArrayList;
import java.util.List;
public class ExcelDataSourceBuilder implements DataSourceBuilder {
private ExcelDataSource excelDataSource = new ExcelDataSource();
private List properties = new ArrayList<>();
public ExcelDataSourceBuilder addProperty(String propertyName) {
properties.add(propertyName);
return this;
}
public ExcelDataSourceBuilder withFilePath(String filePath) {
excelDataSource.setFile(filePath);
return this;
}
public ExcelDataSourceBuilder withWorksheet(String worksheet) {
excelDataSource.setWorksheet(worksheet);
return this;
}
public ExcelDataSourceBuilder startAtCell(String cell) {
excelDataSource.setStartAtCell(cell);
return this;
}
public ExcelDataSourceBuilder ignoreEmpty() {
excelDataSource.setIgnoreEmpty(true);
return this;
}
@Override
public DataSource build() {
DataSource dataSource = new DataSource();
dataSource.setProperties(properties);
dataSource.setExcel(excelDataSource);
return dataSource;
}
}