Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spike for expression language evaluation in display names #4293

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jean-andre-gauthier
Copy link

Overview

  • Introduces a new @ExpressionLanguage annotation, that takes a Class<ExpressionLanguageAdapter> as parameter
  • Introduces a new ExpressionLanguageAdapter interface, that can be implemented to bind in a third-party expression language
  • Adds several tests in ExpressionLanguageMustacheTests, that demonstrate how @ExpressionLanguage / ExpressionLanguageAdapter can be used

I'm marking this as a draft PR, because it's not entirely clear yet how the API should look like. I'll address the items in the Definition of Done once we have more clarity on that.


I hereby agree to the terms of the JUnit Contributor License Agreement.


Definition of Done


@Override
public void append(ArgumentsContext argumentsContext, StringBuffer result) {
expressionLanguageAdapter.format(argumentsContext.arguments.get()[0], result);

Choose a reason for hiding this comment

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

This is not correct, but I'm unsure how we should name multiple arguments, so that they can be accessed by the EL?

Copy link
Member

@sbrannen sbrannen left a comment

Choose a reason for hiding this comment

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

I've only taken a quick glance, but for starters...

This new feature must be applicable to JUnit Jupiter in general, not just for parameterized tests.

So the APIs need to reside in the junit-jupiter-api module.

Please revise your work to take that into account.

See also: #1154 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Introduce extension API for expression language evaluation in display names
3 participants