Skip to content

Builtin Functions for Groovy - Unify Builtin Functions#2322

Merged
rrayst merged 18 commits into
masterfrom
builtin-functions-for-groovy
Nov 19, 2025
Merged

Builtin Functions for Groovy - Unify Builtin Functions#2322
rrayst merged 18 commits into
masterfrom
builtin-functions-for-groovy

Conversation

@predic8

@predic8 predic8 commented Nov 15, 2025

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Adds built-in scripting helpers for templates/interceptors: user(), jsonPath(...), scopes(...), hasScope(...), isXML(), isJSON(), base64Encode(), isBearerAuthorization(), weight(...), isLoggedIn(...), getDefaultSessionLifetime(...).
    • Groovy templates gain parity via a new "fn" binding exposing these helpers.
  • Improvements

    • Unified, more tolerant and consistent behavior across scripting engines for JSONPath, content-type detection, auth/scope checks, probabilistic gating, and session utilities.

@coderabbitai

coderabbitai Bot commented Nov 15, 2025

Copy link
Copy Markdown
Contributor

Warning

Rate limit exceeded

@christiangoerdes has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 22 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between bbb2b98 and 95fd55c.

📒 Files selected for processing (5)
  • core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/lang/ScriptingUtils.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java (1 hunks)
  • core/src/test/java/com/predic8/membrane/core/interceptor/templating/TemplateInterceptorTest.java (3 hunks)
  • core/src/test/java/com/predic8/membrane/core/lang/CommonBuiltInFunctionsTest.java (1 hunks)

Walkthrough

Introduces a centralized public utility class CommonBuiltInFunctions, adds Groovy and SpEL wrappers (GroovyBuiltInFunctions, SpELBuiltInFunctions) and a Groovy "fn" binding; delegates many existing SpEL/Groovy built-ins to the common implementation, renames an exception, adds small test session overrides, and inserts Apache‑2.0 headers in many files. (39 words)

Changes

Cohort / File(s) Summary
Common built-ins
core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java
New public utility class with static helpers: jsonPath(Message), user(Exchange), scopes(...), hasScope(...) overloads, isXML(...), isJSON(...), base64Encode(String), isBearerAuthorization(...), weight(...), session helpers (isLoggedIn, getDefaultSessionLifetime), plus internal helpers for scheme/scope extraction and tolerant JSONPath handling.
SpEL wrapper functions
core/src/main/java/com/predic8/membrane/core/lang/spel/functions/SpELBuiltInFunctions.java, core/src/test/java/.../SpELBuiltInFunctionsTest.java
New SpELBuiltInFunctions class: public static methods (last param SpELExchangeEvaluationContext) delegating to CommonBuiltInFunctions. Tests renamed/updated to call the SpEL wrappers.
Groovy wrapper & binding
core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java, core/src/main/java/com/predic8/membrane/core/lang/ScriptingUtils.java
Added GroovyBuiltInFunctions (instance wrapper using Exchange+Flow) delegating to CommonBuiltInFunctions; ScriptingUtils.createParameterBindings now exposes a "fn" Groovy binding for templates.
Built-in refactor / delegation
core/src/main/java/com/predic8/membrane/core/lang/spel/functions/BuiltInFunctions.java
Existing SpEL built-in implementations replaced with delegations to CommonBuiltInFunctions (user/jsonPath/scopes/hasScope/isXML/isJSON/base64/weight/session helpers).
Exception rename & resolver update
core/src/main/java/com/predic8/membrane/core/lang/spel/functions/BuiltInFunctionException.java, .../BuiltInFunctionResolver.java, .../SpELExchangeExpression.java
Renamed BuildInFunctionExceptionBuiltInFunctionException; updated constructor name and call/catch sites; BuiltInFunctionResolver adjusted to use SpELBuiltInFunctions as provider.
Session-related test overrides
core/src/test/java/.../InMemB2CResourceIntegrationTest.java, .../SyncB2CResourceIntegrationTest.java
Added/updated test overrides to return in-memory or fake sync session managers for integration tests.
Small API addition
core/src/main/java/com/predic8/membrane/core/http/ReadingBodyException.java
New public constructor ReadingBodyException(Exception e) delegating to super(e).
License headers & minor test edits
annot/src/..., core/src/... (many files)
Inserted Apache‑2.0 license headers in numerous source and test files; no behavioral changes except noted files.

Sequence Diagram(s)

sequenceDiagram
    participant Template as Groovy/SpEL template
    participant Scripting as ScriptingUtils
    participant GroovyFn as GroovyBuiltInFunctions
    participant SpELFn as SpELBuiltInFunctions
    participant Common as CommonBuiltInFunctions
    participant Exchange as Exchange
    participant Flow as Flow
    participant Message as Message

    rect rgb(230,240,255)
    Note over Template,Scripting: Parameter binding creation
    Template->>Scripting: requestBindings(exchange, flow)
    Scripting-->>Template: provide "fn" -> GroovyBuiltInFunctions(exchange, flow)
    end

    rect rgb(240,255,230)
    Note over Template,GroovyFn: Groovy calls built-ins (instance)
    Template->>GroovyFn: fn.jsonPath(path) / fn.user() / fn.hasScope(...)
    GroovyFn->>Common: delegate(exchange, flow, args)
    Common->>Exchange: read message / inspect security schemes
    Exchange-->>Common: data
    Common-->>GroovyFn: result
    GroovyFn-->>Template: result
    end

    rect rgb(255,245,230)
    Note over Template,SpELFn: SpEL calls built-ins (static)
    Template->>SpELFn: SpELBuiltInFunctions.jsonPath(path, ctx) / hasScope(ctx)
    SpELFn->>Common: delegate(ctx.getExchange(), ctx.getFlow(), args)
    Common->>Message: parse/inspect as needed
    Common-->>SpELFn: result
    SpELFn-->>Template: result
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

  • Review focus:
    • jsonPath decoding and null/error-tolerant behavior in CommonBuiltInFunctions.jsonPath.
    • Security-scheme extraction, casting, and scope aggregation edge cases.
    • Session bean resolution, logging and session-lifetime semantics.
    • Consistency of argument passing between SpEL/Groovy wrappers and CommonBuiltInFunctions.
    • Exception rename impact across callers and tests.

Possibly related PRs

Suggested reviewers

  • rrayst
  • t-burch
  • predic8

Poem

🐇 I hopped through code with nimble paws,
Collected helpers, fixed some claws.
One "fn" to call, a common chest,
json, scopes, and sessions blessed.
Hop, bind, and run — the functions rest.

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 1.25% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: unifying builtin functions (CommonBuiltInFunctions) and adding Groovy support (GroovyBuiltInFunctions).

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
core/src/main/java/com/predic8/membrane/core/lang/ScriptingUtils.java (1)

107-109: Acknowledge the TODO for test coverage.

The implementation correctly exposes Groovy built-in functions via the fn binding. However, the TODO indicates that tests are missing for both the Groovy interceptor and Template interceptor.

Do you want me to help generate test cases for the Groovy built-in functions, or open an issue to track this task?

core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java (1)

7-10: Acknowledge the TODO for additional function wrappers.

The TODO indicates that other SpEL built-in functions (like jsonPath, weight, isLoggedIn, scopes, hasScope, etc. from BuiltInFunctions.java) should also be wrapped here to achieve full parity between SpEL and Groovy contexts.

Do you want me to help identify which functions from BuiltInFunctions.java should be wrapped next, or open an issue to track this work?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between b657514 and 3fa5312.

📒 Files selected for processing (4)
  • core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/lang/ScriptingUtils.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/lang/spel/functions/BuiltInFunctions.java (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-09-22T19:49:29.473Z
Learnt from: predic8
Repo: membrane/api-gateway PR: 2156
File: pom.xml:0-0
Timestamp: 2025-09-22T19:49:29.473Z
Learning: In the Membrane API Gateway project, jackson-annotations is pinned to version "2.20" instead of using ${jackson.version} (2.20.0) because version 2.20.0 is not available in Maven repository yet for jackson-annotations, while it is available for jackson-core and jackson-databind. This version inconsistency is intentional and necessary due to different release schedules between Jackson modules.

Applied to files:

  • core/src/main/java/com/predic8/membrane/core/lang/spel/functions/BuiltInFunctions.java
🧬 Code graph analysis (3)
core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (1)
core/src/main/java/com/predic8/membrane/core/exchange/Exchange.java (1)
  • Exchange (31-220)
core/src/main/java/com/predic8/membrane/core/lang/spel/functions/BuiltInFunctions.java (1)
core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (1)
  • CommonBuiltInFunctions (16-27)
core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java (1)
core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (1)
  • CommonBuiltInFunctions (16-27)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (java)
🔇 Additional comments (7)
core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (1)

10-15: Acknowledge the TODO for function migration.

The TODO notes the intent to migrate more function implementations from SpEL's BuiltInFunctions to this shared location, promoting code reuse between SpEL and Groovy contexts.

core/src/main/java/com/predic8/membrane/core/lang/spel/functions/BuiltInFunctions.java (4)

19-19: LGTM: Import added for CommonBuiltInFunctions.

The import is necessary to access the shared CommonBuiltInFunctions.user() method.


110-112: LGTM: User function delegates to shared implementation.

The delegation to CommonBuiltInFunctions.user() promotes code reuse between SpEL and Groovy contexts, achieving the PR's goal of unifying built-in functions.


128-130: LGTM: Helper method extracts property retrieval logic.

The getSecuritySchemes helper cleanly encapsulates the retrieval of SECURITY_SCHEMES, improving maintainability and enabling consistent null handling via Optional.ofNullable at the call site.


118-130: Backward compatibility verified—no changes needed.

The refactored getSchemeScopes() correctly flattens scopes from all matching security schemes into a single List<String>. The public API methods (scopes(), hasScope() variants) work correctly with the flattened result: they check for scope presence, not structure. Overlapping scopes appearing multiple times is expected behavior per the test at line 91 of BuiltInFunctionsTest.java, which explicitly validates the flattened list. No breaking changes detected.

core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java (2)

11-17: LGTM: Clean delegation pattern for Groovy integration.

The class correctly extends GroovyObjectSupport for Groovy runtime integration and stores the Exchange as a final field for immutability.


19-21: LGTM: User function delegates to shared implementation.

The delegation to CommonBuiltInFunctions.user() maintains consistency with the SpEL implementation and achieves the PR's goal of unified built-in functions.

…e from Groovy/SpEL

Introduce CommonBuiltInFunctions (jsonPath, scopes/hasScope, isXML/isJSON, base64Encode and helpers),
update GroovyBuiltInFunctions to accept Flow and delegate to CommonBuiltInFunctions, and modify SpEL BuiltInFunctions
to call the shared implementations. Pass Flow when constructing GroovyBuiltInFunctions in ScriptingUtils.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (5)
core/src/main/java/com/predic8/membrane/core/lang/ScriptingUtils.java (1)

107-109: Reminder: Address the TODO comment.

The TODO indicates that tests are missing for built-in functions in Groovy and Template interceptors. Please ensure that the new fn binding and its delegated functions are thoroughly tested.

Do you want me to generate test cases or open a new issue to track this task?

core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java (2)

6-6: Remove unused import.

The import com.predic8.membrane.core.lang.spel.SpELExchangeEvaluationContext is not used in this file and should be removed.

Apply this diff:

-import com.predic8.membrane.core.lang.spel.SpELExchangeEvaluationContext;

11-14: Track remaining function migrations.

The TODO indicates that additional SpEL built-in functions (e.g., weight(), isLoggedIn(), getDefaultSessionLifetime(), isBearerAuthorization()) should be wrapped here for Groovy. Consider tracking this in a separate issue to ensure feature parity between SpEL and Groovy.

Do you want me to open an issue to track the remaining function migrations?

core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (2)

63-66: Consider performance implications of containsAll.

The @SuppressWarnings("SlowListContainsAll") indicates awareness of a potential performance issue. If scopes can be large, consider whether the scope list should be converted to a Set for faster lookups. However, if scope lists are typically small (which is common), the current implementation is acceptable.


19-24: Track remaining function migrations.

The TODO indicates that additional functions from BuiltInFunctions.java should be migrated here. Consider creating a tracking issue for functions like weight(), isLoggedIn(), getDefaultSessionLifetime(), and isBearerAuthorization() to ensure complete migration.

Do you want me to open an issue to track the remaining function migrations from SpEL's BuiltInFunctions?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3fa5312 and 94b916c.

📒 Files selected for processing (4)
  • core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/lang/ScriptingUtils.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/lang/spel/functions/BuiltInFunctions.java (2 hunks)
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-09-22T19:49:29.473Z
Learnt from: predic8
Repo: membrane/api-gateway PR: 2156
File: pom.xml:0-0
Timestamp: 2025-09-22T19:49:29.473Z
Learning: In the Membrane API Gateway project, jackson-annotations is pinned to version "2.20" instead of using ${jackson.version} (2.20.0) because version 2.20.0 is not available in Maven repository yet for jackson-annotations, while it is available for jackson-core and jackson-databind. This version inconsistency is intentional and necessary due to different release schedules between Jackson modules.

Applied to files:

  • core/src/main/java/com/predic8/membrane/core/lang/spel/functions/BuiltInFunctions.java
📚 Learning: 2025-11-15T18:38:23.719Z
Learnt from: predic8
Repo: membrane/api-gateway PR: 2322
File: core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java:18-26
Timestamp: 2025-11-15T18:38:23.719Z
Learning: In the membrane/api-gateway repository, the maintainer predic8 prefers fail-fast behavior where NullPointerExceptions are allowed to crash rather than being caught or having defensive null checks that silently return null, as it makes debugging easier by showing where problems originate.

Applied to files:

  • core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java
🧬 Code graph analysis (3)
core/src/main/java/com/predic8/membrane/core/lang/spel/functions/BuiltInFunctions.java (1)
core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (1)
  • CommonBuiltInFunctions (25-106)
core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (2)
core/src/main/java/com/predic8/membrane/core/lang/spel/SpELExchangeEvaluationContext.java (1)
  • SpELExchangeEvaluationContext (35-216)
core/src/main/java/com/predic8/membrane/core/exchange/Exchange.java (1)
  • Exchange (31-220)
core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java (3)
core/src/main/java/com/predic8/membrane/core/exchange/Exchange.java (1)
  • Exchange (31-220)
core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (1)
  • CommonBuiltInFunctions (25-106)
core/src/main/java/com/predic8/membrane/core/lang/spel/SpELExchangeEvaluationContext.java (1)
  • SpELExchangeEvaluationContext (35-216)
🔇 Additional comments (3)
core/src/main/java/com/predic8/membrane/core/lang/spel/functions/BuiltInFunctions.java (1)

84-118: LGTM: Clean delegation to CommonBuiltInFunctions.

All methods correctly delegate to CommonBuiltInFunctions, maintaining the SpEL signature requirements while centralizing the implementation. The naming of the unused ctx parameter as ignored in base64Encode is a good practice.

core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java (1)

26-64: LGTM: Correct delegations to CommonBuiltInFunctions.

All wrapper methods correctly delegate to CommonBuiltInFunctions with the appropriate parameters (Exchange, Flow, Message) extracted from the instance fields.

core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (1)

29-78: LGTM: Well-structured centralized built-in functions.

The public API methods are clean and correctly implement the shared logic for SpEL and Groovy. The use of Optional.ofNullable in private helpers properly handles null cases while allowing fail-fast NPE behavior in user() as per project conventions.

@membrane-ci-server

Copy link
Copy Markdown

This pull request needs "/ok-to-test" from an authorized committer.

…egate SpEL/Groovy

Move implementations for auth/session/weight/json helpers into CommonBuiltInFunctions,
add isBearerAuthorization, weight, isLoggedIn and getDefaultSessionLifetime, and
wire SpEL and Groovy built-in resolvers to delegate to the common implementations.
Add logging and necessary imports; handle bean resolution failures gracefully.
@christiangoerdes christiangoerdes linked an issue Nov 17, 2025 that may be closed by this pull request

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java (1)

10-13: Clarify or remove the TODO comment.

The TODO suggests wrapping "other functions" for parity with SpEL, but comparing with BuiltInFunctions.java, this class appears to already provide all the corresponding methods. If the work is complete, consider removing this TODO or clarifying what specific functions are still missing.

Do you want me to verify completeness by comparing method signatures between GroovyBuiltInFunctions and BuiltInFunctions, or would you like help opening an issue to track any remaining work?

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 94b916c and 1845eec.

📒 Files selected for processing (3)
  • core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/lang/spel/functions/BuiltInFunctions.java (2 hunks)
🧰 Additional context used
🧠 Learnings (1)
📚 Learning: 2025-11-15T18:38:23.728Z
Learnt from: predic8
Repo: membrane/api-gateway PR: 2322
File: core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java:18-26
Timestamp: 2025-11-15T18:38:23.728Z
Learning: In the membrane/api-gateway repository, the maintainer predic8 prefers fail-fast behavior where NullPointerExceptions are allowed to crash rather than being caught or having defensive null checks that silently return null, as it makes debugging easier by showing where problems originate.

Applied to files:

  • core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java
🧬 Code graph analysis (3)
core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (3)
core/src/main/java/com/predic8/membrane/core/exchange/Exchange.java (1)
  • Exchange (31-220)
core/src/main/java/com/predic8/membrane/core/interceptor/AbstractInterceptorWithSession.java (1)
  • AbstractInterceptorWithSession (27-105)
core/src/main/java/com/predic8/membrane/core/security/BasicHttpSecurityScheme.java (1)
  • BasicHttpSecurityScheme (16-45)
core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java (2)
core/src/main/java/com/predic8/membrane/core/exchange/Exchange.java (1)
  • Exchange (31-220)
core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (1)
  • CommonBuiltInFunctions (30-142)
core/src/main/java/com/predic8/membrane/core/lang/spel/functions/BuiltInFunctions.java (2)
core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (1)
  • CommonBuiltInFunctions (30-142)
core/src/main/java/com/predic8/membrane/core/lang/spel/SpELExchangeEvaluationContext.java (1)
  • SpELExchangeEvaluationContext (35-216)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (java)
🔇 Additional comments (3)
core/src/main/java/com/predic8/membrane/core/lang/spel/functions/BuiltInFunctions.java (1)

16-85: LGTM! Clean delegation refactoring.

The refactoring successfully centralizes built-in function logic in CommonBuiltInFunctions while maintaining the SpEL convention of passing SpELExchangeEvaluationContext as the last parameter. All delegations correctly extract the necessary context (Exchange, Message, Flow) before calling the common implementation.

core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java (1)

14-80: LGTM! Groovy wrapper delegates consistently.

The class provides a clean instance-method wrapper for Groovy contexts, properly leveraging the stored exchange and flow fields to delegate to CommonBuiltInFunctions. All method signatures and delegations are correct.

core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (1)

30-142: LGTM! Well-designed centralized implementation.

The CommonBuiltInFunctions class successfully consolidates built-in function logic for both SpEL and Groovy contexts. The implementation demonstrates good practices:

  • Consistent delegation patterns with appropriate error handling
  • Proper use of Optional.ofNullable in scope-related methods for null safety
  • Clean functional programming style in private helpers
  • Appropriate silent failures (e.g., jsonPath returning null) and logged failures (e.g., isLoggedIn catching exceptions) for templating contexts

The fail-fast behavior in methods like user() aligns with the project's debugging philosophy.

Based on learnings.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java (1)

21-24: Consider adding null parameter validation.

The constructor doesn't validate that exchange and flow are non-null. While these are likely provided by the framework, adding explicit null checks would make failures clearer and prevent NPEs in downstream method calls.

Apply this diff to add defensive checks:

 public GroovyBuiltInFunctions(Exchange exchange, Flow flow) {
+    if (exchange == null) {
+        throw new IllegalArgumentException("exchange must not be null");
+    }
+    if (flow == null) {
+        throw new IllegalArgumentException("flow must not be null");
+    }
     this.exchange = exchange;
     this.flow = flow;
 }
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1845eec and 6a698cb.

📒 Files selected for processing (1)
  • core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java (1 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java (2)
core/src/main/java/com/predic8/membrane/core/exchange/Exchange.java (1)
  • Exchange (31-220)
core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (1)
  • CommonBuiltInFunctions (30-142)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (java)
🔇 Additional comments (2)
core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java (2)

26-80: Excellent delegation pattern implementation.

All methods correctly delegate to CommonBuiltInFunctions with appropriate parameter mapping. The instance-level exchange and flow fields are properly threaded through to the static utility methods, and the method signatures align well with the common implementation.


15-82: Clean design that successfully unifies built-in functions.

The delegation pattern with immutable fields provides a clean wrapper around CommonBuiltInFunctions, achieving the PR objective of unifying built-in functions across Groovy and SpEL. Extending GroovyObjectSupport appropriately enables Groovy runtime integration.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
annot/src/test/java/com/predic8/membrane/annot/util/InMemoryURLStreamHandler.java (1)

55-65: Guard against missing data entries to avoid NPE in getInputStream

If data is null or data.content does not contain the uri, data.content.get(uri) returns null, which will cause a NullPointerException when passed to ByteArrayInputStream. The overlay branch already throws a FileNotFoundException for missing entries; mirroring that behavior for the base data branch would make failures clearer and more consistent.

Consider something along these lines:

-                    return new ByteArrayInputStream(data.content.get(uri));
+                    if (data == null) {
+                        throw new FileNotFoundException("In-memory file system not activated for " + uri);
+                    }
+                    byte[] buffer = data.content.get(uri);
+                    if (buffer == null) {
+                        throw new FileNotFoundException("No in-memory resource for " + uri);
+                    }
+                    return new ByteArrayInputStream(buffer);

This keeps the behavior explicit and avoids a surprising NPE in tests.

🧹 Nitpick comments (2)
core/src/test/java/com/predic8/membrane/integration/withoutinternet/interceptor/oauth2/SyncB2CResourceIntegrationTest.java (1)

20-20: Minor formatting: Missing space before opening brace.

There's a missing space between the class name and the opening brace: OAuth2ResourceB2CIntegrationTest{ should be OAuth2ResourceB2CIntegrationTest {.

Apply this diff:

-public class SyncB2CResourceIntegrationTest extends OAuth2ResourceB2CIntegrationTest{
+public class SyncB2CResourceIntegrationTest extends OAuth2ResourceB2CIntegrationTest {
core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (1)

136-154: Don’t swallow beanFactory misconfiguration in session helpers

Because requireNonNull(exc.getHandler().getTransport().getRouter().getBeanFactory()) sits inside the try, a null beanFactory (misconfigured router) is caught, logged as “Failed to resolve bean…”, and then treated as “not logged in” / lifetime -1. That hides a configuration error that should likely fail fast.

You can keep the graceful fallback for “bean not found” while letting real misconfigurations surface by moving the requireNonNull call outside the try in both methods:

-    public static boolean isLoggedIn(String beanName, Exchange exc) {
-        try {
-            return ((AbstractInterceptorWithSession) requireNonNull(exc.getHandler().getTransport().getRouter().getBeanFactory()).getBean(beanName))
-                    .getSessionManager().getSession(exc).isVerified();
-        } catch (Exception e) {
-            log.info("Failed to resolve bean with name '{}'", beanName);
-            return false;
-        }
-    }
+    public static boolean isLoggedIn(String beanName, Exchange exc) {
+        requireNonNull(exc.getHandler().getTransport().getRouter().getBeanFactory());
+        try {
+            return ((AbstractInterceptorWithSession) exc.getHandler().getTransport().getRouter().getBeanFactory().getBean(beanName))
+                    .getSessionManager().getSession(exc).isVerified();
+        } catch (Exception e) {
+            log.info("Failed to resolve bean with name '{}'", beanName);
+            return false;
+        }
+    }
@@
-    public static long getDefaultSessionLifetime(String beanName, Exchange exc) {
-        try {
-            return ((AbstractInterceptorWithSession) requireNonNull(exc.getHandler().getTransport().getRouter().getBeanFactory()).getBean(beanName))
-                    .getSessionManager().getExpiresAfterSeconds();
-        } catch (Exception e) {
-            log.info("Failed to resolve bean with name '{}'", beanName);
-            return -1;
-        }
-    }
+    public static long getDefaultSessionLifetime(String beanName, Exchange exc) {
+        requireNonNull(exc.getHandler().getTransport().getRouter().getBeanFactory());
+        try {
+            return ((AbstractInterceptorWithSession) exc.getHandler().getTransport().getRouter().getBeanFactory().getBean(beanName))
+                    .getSessionManager().getExpiresAfterSeconds();
+        } catch (Exception e) {
+            log.info("Failed to resolve bean with name '{}'", beanName);
+            return -1;
+        }
+    }

This preserves the “bean missing → false / -1” behavior while surfacing genuine router/beanFactory misconfiguration via an NPE, in line with the fail-fast preference. Based on learnings.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6a698cb and 41f8714.

📒 Files selected for processing (41)
  • annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/AbstractSchema.java (1 hunks)
  • annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/AnyOf.java (1 hunks)
  • annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/BasicSchema.java (1 hunks)
  • annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaArray.java (1 hunks)
  • annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaFactory.java (1 hunks)
  • annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaRef.java (1 hunks)
  • annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaString.java (1 hunks)
  • annot/src/main/java/com/predic8/membrane/annot/generator/util/SchemaGeneratorUtil.java (1 hunks)
  • annot/src/test/java/com/predic8/membrane/annot/ParsingTest.java (1 hunks)
  • annot/src/test/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaObjectTest.java (1 hunks)
  • annot/src/test/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaTest.java (1 hunks)
  • annot/src/test/java/com/predic8/membrane/annot/util/CompositeClassLoader.java (1 hunks)
  • annot/src/test/java/com/predic8/membrane/annot/util/ConcatenatingEnumeration.java (1 hunks)
  • annot/src/test/java/com/predic8/membrane/annot/util/InMemoryClassLoader.java (1 hunks)
  • annot/src/test/java/com/predic8/membrane/annot/util/InMemoryData.java (1 hunks)
  • annot/src/test/java/com/predic8/membrane/annot/util/InMemoryFileObject.java (1 hunks)
  • annot/src/test/java/com/predic8/membrane/annot/util/InMemoryJavaFileObject.java (1 hunks)
  • annot/src/test/java/com/predic8/membrane/annot/util/InMemoryURLStreamHandler.java (1 hunks)
  • annot/src/test/java/com/predic8/membrane/annot/util/InnerFileObject.java (1 hunks)
  • annot/src/test/java/com/predic8/membrane/annot/util/LoggingFileObject.java (1 hunks)
  • annot/src/test/java/com/predic8/membrane/annot/util/LoggingJavaFileObject.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/cli/util/JwkGenerator.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/cli/util/YamlLoader.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/config/xml/XmlConfig.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/http/ReadingBodyException.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/interceptor/log/access/package-info.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/kubernetes/WrongEnumConstantException.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/lang/spel/SpELExchangeExpression.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/lang/spel/functions/BuiltInFunctionException.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/lang/spel/functions/BuiltInFunctionResolver.java (1 hunks)
  • core/src/main/java/com/predic8/membrane/core/util/YamlUtil.java (1 hunks)
  • core/src/test/java/com/predic8/membrane/core/interceptor/log/AccessLogCallTest.java (1 hunks)
  • core/src/test/java/com/predic8/membrane/core/interceptor/oauth2/client/b2c/OAuth2ResourceB2CUnitTest.java (1 hunks)
  • core/src/test/java/com/predic8/membrane/core/util/YamlUtilTest.java (1 hunks)
  • core/src/test/java/com/predic8/membrane/integration/IntegrationTests.java (1 hunks)
  • core/src/test/java/com/predic8/membrane/integration/withoutinternet/interceptor/oauth2/InMemB2CResourceIntegrationTest.java (1 hunks)
  • core/src/test/java/com/predic8/membrane/integration/withoutinternet/interceptor/oauth2/JwtB2CResourceIntegrationTest.java (1 hunks)
  • core/src/test/java/com/predic8/membrane/integration/withoutinternet/interceptor/oauth2/OAuth2ResourceB2CIntegrationTest.java (1 hunks)
  • core/src/test/java/com/predic8/membrane/integration/withoutinternet/interceptor/oauth2/SyncB2CResourceIntegrationTest.java (1 hunks)
✅ Files skipped from review due to trivial changes (27)
  • annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/AnyOf.java
  • annot/src/test/java/com/predic8/membrane/annot/util/InMemoryData.java
  • core/src/main/java/com/predic8/membrane/core/cli/util/YamlLoader.java
  • annot/src/test/java/com/predic8/membrane/annot/util/InMemoryFileObject.java
  • core/src/main/java/com/predic8/membrane/core/cli/util/JwkGenerator.java
  • core/src/test/java/com/predic8/membrane/integration/withoutinternet/interceptor/oauth2/JwtB2CResourceIntegrationTest.java
  • annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaRef.java
  • annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaString.java
  • annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/AbstractSchema.java
  • annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaArray.java
  • annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaFactory.java
  • core/src/main/java/com/predic8/membrane/core/interceptor/log/access/package-info.java
  • annot/src/test/java/com/predic8/membrane/annot/util/ConcatenatingEnumeration.java
  • core/src/main/java/com/predic8/membrane/core/util/YamlUtil.java
  • core/src/test/java/com/predic8/membrane/core/interceptor/oauth2/client/b2c/OAuth2ResourceB2CUnitTest.java
  • annot/src/test/java/com/predic8/membrane/annot/util/InMemoryJavaFileObject.java
  • annot/src/test/java/com/predic8/membrane/annot/util/LoggingJavaFileObject.java
  • annot/src/test/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaTest.java
  • annot/src/test/java/com/predic8/membrane/annot/ParsingTest.java
  • annot/src/test/java/com/predic8/membrane/annot/generator/kubernetes/model/SchemaObjectTest.java
  • core/src/test/java/com/predic8/membrane/integration/IntegrationTests.java
  • annot/src/main/java/com/predic8/membrane/annot/generator/util/SchemaGeneratorUtil.java
  • core/src/main/java/com/predic8/membrane/core/config/xml/XmlConfig.java
  • core/src/main/java/com/predic8/membrane/core/kubernetes/WrongEnumConstantException.java
  • annot/src/test/java/com/predic8/membrane/annot/util/InnerFileObject.java
  • annot/src/test/java/com/predic8/membrane/annot/util/InMemoryClassLoader.java
  • annot/src/test/java/com/predic8/membrane/annot/util/LoggingFileObject.java
🚧 Files skipped from review as they are similar to previous changes (1)
  • core/src/main/java/com/predic8/membrane/core/lang/groovy/GroovyBuiltInFunctions.java
🧰 Additional context used
🧠 Learnings (2)
📚 Learning: 2025-07-28T16:28:17.849Z
Learnt from: rrayst
Repo: membrane/api-gateway PR: 1977
File: core/src/main/java/com/predic8/membrane/core/interceptor/opentelemetry/OpenTelemetryInterceptor.java:107-109
Timestamp: 2025-07-28T16:28:17.849Z
Learning: In Java exception handling for OpenTelemetry body logging, use log.debug() level with ExceptionUtil.concatMessageAndCauseMessages(e) to log body reading failures. This prevents cluttering info logs with potentially common stream reading issues while still providing comprehensive error information when debug logging is enabled.

Applied to files:

  • core/src/main/java/com/predic8/membrane/core/http/ReadingBodyException.java
📚 Learning: 2025-11-15T18:38:23.728Z
Learnt from: predic8
Repo: membrane/api-gateway PR: 2322
File: core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java:18-26
Timestamp: 2025-11-15T18:38:23.728Z
Learning: In the membrane/api-gateway repository, the maintainer predic8 prefers fail-fast behavior where NullPointerExceptions are allowed to crash rather than being caught or having defensive null checks that silently return null, as it makes debugging easier by showing where problems originate.

Applied to files:

  • core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java
🧬 Code graph analysis (1)
core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (3)
core/src/main/java/com/predic8/membrane/core/exchange/Exchange.java (1)
  • Exchange (31-220)
core/src/main/java/com/predic8/membrane/core/interceptor/AbstractInterceptorWithSession.java (1)
  • AbstractInterceptorWithSession (27-105)
core/src/main/java/com/predic8/membrane/core/security/BasicHttpSecurityScheme.java (1)
  • BasicHttpSecurityScheme (16-45)
🔇 Additional comments (14)
core/src/main/java/com/predic8/membrane/core/http/ReadingBodyException.java (1)

1-13: LGTM! License header properly added.

The Apache 2.0 license header is correctly formatted and appropriate for the file.

annot/src/test/java/com/predic8/membrane/annot/util/CompositeClassLoader.java (1)

1-14: LGTM! License header correctly added.

The Apache 2.0 license header follows the standard format with appropriate copyright year and holder information.

core/src/test/java/com/predic8/membrane/integration/withoutinternet/interceptor/oauth2/OAuth2ResourceB2CIntegrationTest.java (1)

1-14: LGTM! Standard license header addition.

The Apache 2.0 license header is correctly formatted and properly credits predic8 GmbH.

core/src/test/java/com/predic8/membrane/integration/withoutinternet/interceptor/oauth2/InMemB2CResourceIntegrationTest.java (2)

1-14: LGTM! Standard license header addition.

The Apache 2.0 license header is correctly formatted.


20-24: LGTM! Appropriate test session manager override.

The override correctly provides an InMemorySessionManager for this test implementation, which is suitable for in-memory session testing scenarios.

core/src/test/java/com/predic8/membrane/integration/withoutinternet/interceptor/oauth2/SyncB2CResourceIntegrationTest.java (2)

1-14: LGTM! Standard license header addition.

The Apache 2.0 license header is correctly formatted.


21-24: LGTM! Appropriate test session manager override.

The override correctly provides a FakeSyncSessionStoreManager for synchronous session store testing.

annot/src/test/java/com/predic8/membrane/annot/util/InMemoryURLStreamHandler.java (1)

1-13: Apache 2.0 license header addition looks correct

The header text and formatting are standard, match Apache 2.0, and do not affect behavior. No further changes needed here.

core/src/test/java/com/predic8/membrane/core/interceptor/log/AccessLogCallTest.java (1)

1-13: License header addition looks good

Apache 2.0 header is correctly formatted and placed before the package declaration; no impact on the ArchUnit test behavior.

core/src/test/java/com/predic8/membrane/core/util/YamlUtilTest.java (1)

1-13: License header added correctly

Apache 2.0 header is consistent with the rest of the project and does not affect the YamlUtil tests.

annot/src/main/java/com/predic8/membrane/annot/generator/kubernetes/model/BasicSchema.java (1)

1-25: Constructors cleanly expose superclass initialization

Adding both the named and no-arg constructors that delegate directly to super(...) broadens usage without changing behavior; looks good.

core/src/main/java/com/predic8/membrane/core/lang/spel/functions/BuiltInFunctionResolver.java (1)

37-45: Exception rename is consistent with new BuiltInFunctionException

Wrapping invocation failures in BuiltInFunctionException instead of the old typoed type keeps behavior the same while aligning with the renamed exception class in this package.

core/src/main/java/com/predic8/membrane/core/lang/spel/functions/BuiltInFunctionException.java (1)

16-23: LGTM! Typo correction improves naming consistency.

The class rename from BuildInFunctionException to BuiltInFunctionException correctly fixes the spelling and aligns with standard naming conventions for "built-in" functionality.

core/src/main/java/com/predic8/membrane/core/lang/spel/SpELExchangeExpression.java (1)

99-99: Typo fix verified as complete. The search for the old misspelled name "BuildInFunctionException" returns no results, and the corrected name "BuiltInFunctionException" is properly used across:

  • Exception catch site (line 99, SpELExchangeExpression.java)
  • Exception throw site (line 44, BuiltInFunctionResolver.java)
  • Class definition (line 16, BuiltInFunctionException.java)

All references have been consistently updated.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
core/src/main/java/com/predic8/membrane/core/lang/spel/functions/SpELBuiltInFunctions.java (2)

21-28: Consider adding method-level JavaDoc.

The class-level documentation clearly explains the architectural constraints. However, individual methods lack JavaDoc describing their purpose, parameters, and return values. Adding method-level documentation would improve discoverability and maintenance, especially since these methods are automatically registered in the SpEL context.


35-37: Consider consistent parameter naming for unused context.

The context parameter is named ignored in weight() and base64Encode(), while other methods use ctx. While naming it ignored clearly signals the parameter isn't used, using ctx consistently across all methods would improve uniformity.

Also applies to: 83-85

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 41f8714 and bbb2b98.

📒 Files selected for processing (3)
  • core/src/main/java/com/predic8/membrane/core/lang/spel/functions/BuiltInFunctionResolver.java (2 hunks)
  • core/src/main/java/com/predic8/membrane/core/lang/spel/functions/SpELBuiltInFunctions.java (1 hunks)
  • core/src/test/java/com/predic8/membrane/core/lang/spel/functions/SpELBuiltInFunctionsTest.java (3 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • core/src/main/java/com/predic8/membrane/core/lang/spel/functions/BuiltInFunctionResolver.java
🧰 Additional context used
🧬 Code graph analysis (2)
core/src/main/java/com/predic8/membrane/core/lang/spel/functions/SpELBuiltInFunctions.java (2)
core/src/main/java/com/predic8/membrane/core/lang/CommonBuiltInFunctions.java (1)
  • CommonBuiltInFunctions (44-156)
core/src/main/java/com/predic8/membrane/core/lang/spel/SpELExchangeEvaluationContext.java (1)
  • SpELExchangeEvaluationContext (35-216)
core/src/test/java/com/predic8/membrane/core/lang/spel/functions/SpELBuiltInFunctionsTest.java (1)
core/src/main/java/com/predic8/membrane/core/lang/spel/functions/SpELBuiltInFunctions.java (1)
  • SpELBuiltInFunctions (29-86)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Analyze (java)
🔇 Additional comments (2)
core/src/test/java/com/predic8/membrane/core/lang/spel/functions/SpELBuiltInFunctionsTest.java (1)

27-134: LGTM! Clean refactoring to use SpELBuiltInFunctions.

The test file has been correctly updated to reference the new SpELBuiltInFunctions class. All static imports, class name, and method invocations have been consistently renamed. The test logic and assertions remain unchanged, preserving existing test coverage.

core/src/main/java/com/predic8/membrane/core/lang/spel/functions/SpELBuiltInFunctions.java (1)

31-85: LGTM! Clean delegation pattern to CommonBuiltInFunctions.

All methods correctly follow the documented constraints:

  • Static methods for SpEL registration
  • SpELExchangeEvaluationContext as the last parameter
  • Proper delegation to CommonBuiltInFunctions with appropriate context extraction

The method overloads for scopes() and hasScope() are well-structured and cover different use cases.

@christiangoerdes

Copy link
Copy Markdown
Collaborator

/ok-to-test

@rrayst rrayst merged commit cfd22b3 into master Nov 19, 2025
3 of 4 checks passed
@rrayst rrayst deleted the builtin-functions-for-groovy branch November 19, 2025 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Builtin Functions for Groovy and Template

3 participants