package jetbrains.mps.baseLanguage.unitTest.platform;

/*Generated by MPS */

import java.util.Optional;
import org.jetbrains.mps.openapi.model.SNode;

/**
 * The request object that is sent to a {@link jetbrains.mps.baseLanguage.unitTest.platform.TestDiscoveryParticipant }.
 */
public class TestDiscoveryRequest {

  private final TestDescriptor myRootContainer;

  public TestDiscoveryRequest(TestDescriptor rootContainer) {
    myRootContainer = rootContainer;
  }

  /**
   * Allows to access the container that is to contain all the tests created for this request.
   */
  public final TestDescriptor peekContainer() {
    return myRootContainer;
  }

  public Optional<TestDescriptor> discover(SNode sNode) {
    return TestPlatform.getInstance().getAggregateDiscoveryParticipant().discover(sNode, this);
  }

}
