protected static TestCase getTestCase(ExtensionContext extensionContext) {
        Assert.notNull(extensionContext, "ExtensionContext must not be null");
        return extensionContext.getRoot().getStore(NAMESPACE).getOrComputeIfAbsent(getBaseKey(extensionContext) + TestCase.class.getSimpleName(), key -> {
            if (isDesignerMethod(extensionContext.getRequiredTestMethod())) {
                return getTestDesigner(extensionContext).getTestCase();
            } else if (isRunnerMethod(extensionContext.getRequiredTestMethod())) {
                return getTestRunner(extensionContext).getTestCase();
            } else if (isXmlTestMethod(extensionContext.getRequiredTestMethod())) {
                return CitrusBaseExtension.getXmlTestCase(extensionContext);
            } else if (isDesignerClass(extensionContext.getRequiredTestClass())) {
                return getTestDesigner(extensionContext).getTestCase();
            } else if (Stream.of(extensionContext.getRequiredTestClass().getDeclaredFields()).anyMatch(field -> TestRunner.class.isAssignableFrom(field.getType()))) {
                return getTestRunner(extensionContext).getTestCase();
            } else {
                throw new CitrusRuntimeException("Neither test class nor test method is using any of test runner, designer or Xml test file.");
            }
        }, TestCase.class);
    }
protected static TestCase getTestCase ( ExtensionContext extensionContext ) { Assert . notNull ( extensionContext , "ExtensionContext must not be null" ) ; return extensionContext . getRoot ( ) . getStore ( NAMESPACE ) . getOrComputeIfAbsent ( getBaseKey ( extensionContext ) + TestCase . class . getSimpleName ( ) , key -> { if ( isDesignerMethod ( extensionContext . getRequiredTestMethod ( ) ) ) { return getTestDesigner ( extensionContext ) . getTestCase ( ) ; } else if ( isRunnerMethod ( extensionContext . getRequiredTestMethod ( ) ) ) { return getTestRunner ( extensionContext ) . getTestCase ( ) ; } else if ( isXmlTestMethod ( extensionContext . getRequiredTestMethod ( ) ) ) { return CitrusBaseExtension . getXmlTestCase ( extensionContext ) ; } else if ( isDesignerClass ( extensionContext . getRequiredTestClass ( ) ) ) { return getTestDesigner ( extensionContext ) . getTestCase ( ) ; } else if ( Stream . of ( extensionContext . getRequiredTestClass ( ) . getDeclaredFields ( ) ) . anyMatch ( field -> TestRunner . class . isAssignableFrom ( field . getType ( ) ) ) ) { return getTestRunner ( extensionContext ) . getTestCase ( ) ; } else { throw new CitrusRuntimeException ( "Neither test class nor test method is using any of test runner, designer or Xml test file." ) ; } } , TestCase . class ) ; }
Get the {@link TestCase} associated with the supplied {@code ExtensionContext} and its required test class name.
@return the {@code TestCase} (never {@code null})