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

rest.RestMultiLoader 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 org.apache.commons.lang3.Validate;
import cucumber.runtime.io.MultiLoader;
import cucumber.runtime.io.Resource;
import cucumber.runtime.io.ResourceLoader;

public class RestMultiLoader implements ResourceLoader {
   private MultiLoader loader;
   private CucumberRestClient restClient;

   public RestMultiLoader(ClassLoader classLoader) {
      loader = new MultiLoader(classLoader);
   }

   public void setRestClient(CucumberRestClient restClient) {
      Validate.notNull(restClient);
      this.restClient = restClient;
   }

   public boolean hasRestClientSet() {
      return restClient != null;
   }

   public Iterable resources(String path, String suffix) {
      if (RestCucumberFeatureLoader.REST_CLIENT_KEY.equalsIgnoreCase(suffix)) {
         return new RestResourceLoader(restClient);
      }
      return loader.resources(path, suffix);
   }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy