Skip to content

Add BeforeEachTemplating callback #883

Closed
@ctapobep

Description

@ctapobep

Current BeforeEachCallback and BeforeTestExecutionCallback are invoked after ArgumentProvider finished. Would be either add more methods to the existing callbacks or to create a new callback that would run before the ArgumentProvider starts.

Rationale: in my extension I'd like to impact how the data is generated in the ArgumentProviders (I'm interested in @MethodSource in particular). So that it's possible to set the seed for randomization that happens in the @MethodSource.

Activity

nipafx

nipafx commented on Jun 13, 2017

@nipafx

@ctapobep Would #853 cover your use case.

ctapobep

ctapobep commented on Jun 14, 2017

@ctapobep
Author

I don't think so - I need a hook before argument providers are run.

nipafx

nipafx commented on Jun 15, 2017

@nipafx

Why not create your own @RandomMethodSource argument provider, then?

Regarding your proposal to modify existing callbacks: Note that argument providers are slightly separate from the rest of Jupiter because, strictly speaking, they are part of an extension (junit-jupiter-params). In my opinion this closes off the possibility to modify existing extension points to interact with them. On top of that, such a modification would also undermine the effort to keep extension points simple and focused.

This leaves your proposal to add a callback to providers that they call before resolution...

stale

stale commented on May 13, 2021

@stale

This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. Thank you for your contribution.

stale

stale commented on Jun 3, 2021

@stale

This issue has been automatically closed due to inactivity. If you have a good use case for this feature, please feel free to reopen the issue.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @sbrannen@ctapobep@nipafx

        Issue actions

          Add BeforeEachTemplating callback · Issue #883 · junit-team/junit-framework