rest.RestResourceLoader Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of rest-cucumber Show documentation
Show all versions of rest-cucumber Show documentation
Rest Cucumber allows you to attach a rest client for retrieval of Cucumber feature files and posting of Cucumber test results
package rest;
import java.util.*;
import org.apache.commons.lang3.Validate;
import cucumber.runtime.io.Resource;
public class RestResourceLoader implements Iterable {
private List issues;
private CucumberRestClient restClient;
public RestResourceLoader(CucumberRestClient restClient) {
Validate.notNull(restClient);
this.restClient = restClient;
issues = new ArrayList();
loadIssues();
}
private void loadIssues() {
Set issueKeys = restClient.getIssues();
Validate.notEmpty(issueKeys);
for (String issueKey : issueKeys) {
issues.add(new RestResource(issueKey, "LoadedFromRestClient", restClient));
}
}
public List getIssues() {
return issues;
}
public Iterator iterator() {
return new RestResourceIterator(issues);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy