Skip to content

[UnitTest] Check for specific amount of events to arrive #1358

@wolframhaussig

Description

@wolframhaussig

This issue is based on this discussion.

I want to create a test that checks for a specific number of events being published. The usecase here is that it should only publish events until a given limit of currently executing jobs is reached. This limit is used to prevent one instance of the service to block all jobs while another instance is idle.

scenario.stimulate(() -> collector.poll())
            .andWaitAtMost(Duration.ofSeconds(5))
            .andWaitForEventOfType(NewJobEvent.class)
           .count(3)
            .toArrive();

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions