package de.retest.recheck.persistence;

import de.retest.recheck.TestCaseFinder;

/**
 * The default implementation that derives test suite and test case name from the test class and test method, working
 * for both JUnit and TestNG.
 */
public class ClassAndMethodBasedNamingStrategy implements NamingStrategy {

	@Override
	public String getSuiteName() {
		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." ) );
	}

	@Override
	public String getTestName() {
		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." ) );
	}
}

@@ -618,27 +618,45 @@
 %22Please 
-instantiate
+call %60suiteName(%5C%22name%5C%22)%60 in
  Recheck
@@ -672,32 +672,99 @@
  RecheckOptions,
+ giving an explicit name, %22%0A%09%09%09%09%09%09+ %22or instantiate it in a method,
  and provide a d
@@ -768,33 +768,30 @@
 a different 
-FileNamer
+Naming
 Strategy.%22 )
@@ -1249,17 +1249,14 @@
 ent 
-FileNamer
+Naming
 Stra

Update exception msg and add suiteName hint