com.smartbear.readyapi.client.teststeps.datasource.DataSourceTestStepBuilder 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
package com.smartbear.readyapi.client.teststeps.datasource;
import com.smartbear.readyapi.client.model.DataSourceTestStep;
import com.smartbear.readyapi.client.model.TestStep;
import com.smartbear.readyapi.client.teststeps.TestStepBuilder;
import com.smartbear.readyapi.client.teststeps.TestStepTypes;
import java.util.LinkedList;
import java.util.List;
public class DataSourceTestStepBuilder implements TestStepBuilder {
private DataSourceTestStep testStep = new DataSourceTestStep();
private DataSourceBuilderType dataSourceBuilder;
private List nestedTestSteps = new LinkedList<>();
public DataSourceTestStepBuilder named(String name) {
testStep.setName(name);
return this;
}
public DataSourceTestStepBuilder withDataSource(DataSourceBuilderType dataSourceBuilder) {
this.dataSourceBuilder = dataSourceBuilder;
return this;
}
protected DataSourceBuilderType getDataSourceBuilder() {
return dataSourceBuilder;
}
public DataSourceTestStepBuilder addTestStep(TestStepBuilder testStepBuilder) {
this.nestedTestSteps.add(testStepBuilder.build());
return this;
}
@Override
public DataSourceTestStep build() {
testStep.setType(TestStepTypes.DATA_SOURCE.getName());
testStep.setDataSource(dataSourceBuilder.build());
testStep.setTestSteps(nestedTestSteps);
return testStep;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy