All Downloads are FREE. Search and download functionalities are using the official Maven repository.

rest.RestResourceLoader Maven / Gradle / Ivy

Go to download

Rest Cucumber allows you to attach a rest client for retrieval of Cucumber feature files and posting of Cucumber test results

There is a newer version: 1.3
Show newest version
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