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

com.rationaleemotions.cucumber.PluginAwareCucumberOptions Maven / Gradle / Ivy

There is a newer version: 1.2.2
Show newest version
package com.rationaleemotions.cucumber;

import cucumber.api.CucumberOptions;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

public class PluginAwareCucumberOptions extends AbstractCucumberOptions {
  private List plugins;

  private PluginAwareCucumberOptions(CucumberOptions options, String[] plugins) {
    super(options);
    this.plugins = new ArrayList<>(Arrays.asList(options.plugin()));
    this.plugins.addAll(Arrays.asList(plugins));
  }

  static PluginAwareCucumberOptions newInstance(CucumberOptions options) {
    return new PluginAwareCucumberOptions(
        options, new String[] {BrowserSpawningFormatter.class.getName()});
  }

  @Override
  public String[] plugin() {
    List pluginsToReturn = new ArrayList<>(this.plugins);
    pluginsToReturn.addAll(Arrays.asList(super.plugin()));
    return pluginsToReturn.toArray(new String[0]);
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy