package de.retest.recheck;

import de.retest.recheck.persistence.FileNamer;
import de.retest.recheck.persistence.NamingStrategy;
import de.retest.recheck.persistence.ProjectLayout;

/**
 * @deprecated Use {@link NamingStrategy} and {@link ProjectLayout} instead.
 */
@Deprecated
public interface FileNamerStrategy extends NamingStrategy {

	@Override
	default String getSuiteName() {
		return getTestClassName();
	}

	@Override
	default String getTestName() {
		return getTestMethodName();
	}

	/**
	 * Creates a file namer for the given base names. For Golden Master files, these typically follow the format
	 * <code>${TEST_CLASS_NAME}/${TEST_METHOD_NAME}.${STEP_NAME}</code>, whereas test report files only use
	 * <code>${TEST_CLASS_NAME}</code>.
	 *
	 * @param baseNames
	 *            the base names to be used
	 * @return a file namer using the given base names
	 */
	FileNamer createFileNamer( String... baseNames );

	/**
	 * Determines the current test class name.
	 *
	 * @return name of the current test class
	 */
	default String getTestClassName() {
		return TestCaseFinder.getInstance() //
				.findTestCaseClassNameInStack() //
				.orElseThrow( () -> new IllegalStateException( "Couldn't identify test class in call stack.\n"
						+ "This is needed to dynamically name the Golden Master files.\n "
						+ "Please instantiate RecheckImpl with RecheckOptions, and provide a different FileNamerStrategy." ) );
	}

	/**
	 * Determines the current test method name.
	 *
	 * @return name of the current test method
	 */
	default String getTestMethodName() {
		return TestCaseFinder.getInstance() //
				.findTestCaseMethodNameInStack() //
				.orElseThrow( () -> new IllegalStateException( "Couldn't identify test method in call stack.\n"
						+ "This is needed to dynamically name the Golden Master files.\n"
						+ "Please call `startTest(\"name\")`, giving an explicit name, "
						+ "or instantiate RecheckImpl with RecheckOptions, and provide a different FileNamerStrategy." ) );
	}

}

@@ -1314,25 +1314,91 @@
  %22%0A%09%09%09%09%09%09+ %22
-P
+Note that FileNamerStrategy is deprecated.%5Cn%22%0A%09%09%09%09%09%09+ %22Therefore, p
 lease instan
@@ -1450,35 +1450,36 @@
 ovide a 
-different FileNamer
+corresponding Naming
 Strategy
@@ -1893,17 +1893,83 @@
 %09%09%09%09%09+ %22
-P
+Note that FileNamerStrategy is deprecated.%5Cn%22%0A%09%09%09%09%09%09+ %22Therefore, p
 lease ca
@@ -2096,27 +2096,28 @@
 e a 
-different FileNamer
+corresponding Naming
 Stra

Add deprecation warning