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

io.github.testtemplate.core.TestDefinition Maven / Gradle / Ivy

package io.github.testtemplate.core;

import io.github.testtemplate.ContextualTemplate;
import io.github.testtemplate.ContextualValidator;
import io.github.testtemplate.TestType;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static java.util.Collections.unmodifiableList;
import static java.util.Collections.unmodifiableMap;

public final class TestDefinition {

  private final String name;

  private final TestType type;

  private final ContextualTemplate template;

  private final List variables = new ArrayList<>();

  private final List modifiers = new ArrayList<>();

  private final ContextualValidator validator;

  private final Map attributes = new HashMap<>();

  public TestDefinition(
      String name,
      TestType type,
      ContextualTemplate template,
      Collection variables,
      Collection modifiers,
      ContextualValidator validator,
      Map attributes) {
    this.name = name;
    this.type = type;
    this.template = template;
    this.variables.addAll(variables);
    this.modifiers.addAll(modifiers);
    this.validator = validator;
    this.attributes.putAll(attributes);
  }

  public String getName() {
    return name;
  }

  public TestType getType() {
    return type;
  }

  public ContextualTemplate getTemplate() {
    return template;
  }

  public List getVariables() {
    return unmodifiableList(variables);
  }

  public List getModifiers() {
    return unmodifiableList(modifiers);
  }

  public ContextualValidator getValidator() {
    return validator;
  }

  public Map getAttributes() {
    return unmodifiableMap(attributes);
  }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy