/*
 * Copyright 2015-2017 the original author or authors.
 *
 * All rights reserved. This program and the accompanying materials are
 * made available under the terms of the Eclipse Public License v1.0 which
 * accompanies this distribution and is available at
 *
 * http://www.eclipse.org/legal/epl-v10.html
 */

package org.junit.jupiter.api.extension;

import static java.util.Collections.emptyList;
import static org.junit.platform.commons.meta.API.Usage.Experimental;

import java.util.List;

import org.junit.platform.commons.meta.API;

/**
 * {@code TestTemplateInvocationContext} represents the <em>context</em> of a
 * single invocation of a {@linkplain org.junit.jupiter.api.TestTemplate test
 * template}.
 *
 * <p>Each context is provided by a
 * {@link TestTemplateInvocationContextProvider}.
 *
 * @since 5.0
 * @see org.junit.jupiter.api.TestTemplate
 * @see TestTemplateInvocationContextProvider
 */
@API(Experimental)
public interface TestTemplateInvocationContext {

	/**
	 * Get the display name for this invocation.
	 *
	 * <p>The supplied {@code invocationIndex} is incremented by the framework
	 * with each test invocation. Thus, in the case of multiple active
	 * {@linkplain TestTemplateInvocationContextProvider providers}, only the
	 * first active provider receives indices starting with {@code 1}.
	 *
	 * @param invocationIndex the index of this invocation (1-based).
	 * @return the display name for this invocation; never {@code null} or blank
	 */
	default String getDisplayName(int invocationIndex) {
		return "[" + invocationIndex + "]";
	}

	/**
	 * Get the additional {@linkplain Extension extensions} for this invocation.
	 *
	 * <p>The extensions provided by this method will only be used for this
	 * invocation of the test template. Thus, it does not make sense to return
	 * an extension that acts solely on the container level (e.g.
	 * {@link BeforeAllCallback}).
	 *
	 * @return the additional extensions for this invocation; never {@code null}
	 * but potentially empty
	 */
	default List<Extension> getAdditionalExtensions() {
		return emptyList();
	}

}

@@ -748,19 +748,16 @@
 ded by a
-%0A *
  %7B@link 
@@ -796,16 +796,16 @@
 vider%7D.%0A
+
  *%0A * @s
@@ -1317,24 +1317,184 @@
 ode 1%7D.%0A%09 *%0A
+%09 * %3Cp%3EThe default implementation returns the supplied %7B@code invocationIndex%7D%0A%09 * wrapped in brackets &mdash; for example, %7B@code %5B1%5D%7D, %7B@code %5B42%5D%7D, etc.%0A%09 *%0A
 %09 * @param i
@@ -2026,16 +2026,16 @@
 l (e.g.%0A
-
 %09 * %7B@li
@@ -2058,24 +2058,85 @@
 back%7D).%0A%09 *%0A
+%09 * %3Cp%3EThe default implementation returns an empty list.%0A%09 *%0A
 %09 * @return 

Document default semantics in TestTemplateInvocationContext