diff --git a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/RequiresFunction.java b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/RequiresFunction.java index d74c712e74..0702759ce5 100644 --- a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/RequiresFunction.java +++ b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/RequiresFunction.java @@ -28,7 +28,7 @@ import org.junit.jupiter.api.extension.ExtendWith; @Target({ ElementType.METHOD, ElementType.TYPE, ElementType.ANNOTATION_TYPE }) @Retention(RetentionPolicy.RUNTIME) -@ExtendWith({ SessionFactoryExtension.class, RequireFunctionExtension.class }) +@ExtendWith({ SessionFactoryExtension.class, RequiresFunctionExtension.class }) public @interface RequiresFunction { /** * The key for the function (as used in the SqmFunctionRegistry) diff --git a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/RequireFunctionExtension.java b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/RequiresFunctionExtension.java similarity index 83% rename from hibernate-spatial/src/test/java/org/hibernate/spatial/testing/RequireFunctionExtension.java rename to hibernate-spatial/src/test/java/org/hibernate/spatial/testing/RequiresFunctionExtension.java index c3ffb48c7e..7b59a15ebc 100644 --- a/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/RequireFunctionExtension.java +++ b/hibernate-spatial/src/test/java/org/hibernate/spatial/testing/RequiresFunctionExtension.java @@ -23,12 +23,12 @@ import org.junit.jupiter.api.extension.ExtensionContext; import org.jboss.logging.Logger; -public class RequireFunctionExtension implements ExecutionCondition { +public class RequiresFunctionExtension implements ExecutionCondition { private static final ConditionEvaluationResult ENABLED = ConditionEvaluationResult.enabled( "No applicable @RequireFunction annotation" ); - private static final Logger log = Logger.getLogger( RequireFunctionExtension.class ); + private static final Logger log = Logger.getLogger( RequiresFunctionExtension.class ); @Override public ConditionEvaluationResult evaluateExecutionCondition(ExtensionContext context) { @@ -38,8 +38,6 @@ public class RequireFunctionExtension implements ExecutionCondition { return ENABLED; } - final SqmFunctionRegistry functionRegistry = new SqmFunctionRegistry(); - ExtensionContext.Store store = JUnitHelper.locateExtensionStore( SessionFactoryExtension.class, context, @@ -59,11 +57,9 @@ public class RequireFunctionExtension implements ExecutionCondition { if ( requiresFunctions.isPresent() ) { String functionKey = requiresFunctions.get().key(); - SpatialFunctionContributor contributor = new SpatialFunctionContributor(); - contributor.contributeFunctions( - functionRegistry, - existing.getSessionFactory().getServiceRegistry() - ); + SqmFunctionRegistry functionRegistry = existing.getSessionFactory() + .getQueryEngine() + .getSqmFunctionRegistry(); if ( functionRegistry.findFunctionDescriptor( functionKey ) == null ) { return ConditionEvaluationResult.disabled( String.format( Locale.ROOT,