@VisibleForTesting
  void loadUdfFromClass(final Class<?>... udfClasses) {
    for (final Class<?> theClass : udfClasses) {
      loadUdfFromClass(
          theClass, KsqlScalarFunction.INTERNAL_PATH);
    }
  }
@Test
  public void shouldThrowOnReturnDecimalWithoutSchemaProvider() throws Exception {
    // Given:
    final MutableFunctionRegistry functionRegistry = new InternalFunctionRegistry();
    final Path udfJar = new File("src/test/resources/udf-failing-tests.jar").toPath();
    try (final UdfClassLoader udfClassLoader = newClassLoader(udfJar, PARENT_CLASS_LOADER, resourceName -> false)) {
      final Class<?> clazz = udfClassLoader.loadClass("org.damian.ksql.udf."
          + "ReturnDecimalWithoutSchemaProviderUdf");
      final UdfLoader udfLoader = new UdfLoader(
          functionRegistry,
          empty(),
          create(EMPTY),
          true
      );

      // When:
      final Exception e = assertThrows(
          KsqlException.class,
          () -> udfLoader.loadUdfFromClass(clazz)
      );

      // Then:
      assertThat(e.getMessage(), containsString(
          "Cannot load UDF ReturnDecimalWithoutSchemaProvider. DECIMAL return type is not " +
              "supported without an explicit schema"));
    }
  }