Skip to content

ApplicationListener<ApplicationReadyEvent> runs before @EnableWiremock-setup #84

Open
@mixaaaa

Description

@mixaaaa

Proposal

Info

We are actually facing the issue that we are having a rest call for a configuration setup being called in an ApplicationListener using the <ApplicationReadyEvent>. Switching from @AutoConfigureWireMock to @EnableWireMock brought us to the problem that our test configuration class is useless. This configuration has an ApplicationStartedEvent-Listener which was running before the ReadyListener and which gave us the opportunity to set up our wiremock-stub.

Because of WireMockSpringJunitExtension.class it seems that all Wiremock server setup is actually running in the @BeforeEach-Phase. This seems to be too late to stub a mock in lifecycle events like application ready or started.

Feature-Request

Add a possibility to run the setup already in the @BeforeClass phase or something similar which gives the opportunity to set up the WireMockServer before Spring lifecycle events.

References

none - sorry

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions