Skip to content

Assertions with contains should fail when jfrEvents.events is empty #210

Description

@FBibonne

Given a test case where no enabled event is recorded, for example :

    @Test
    @EnableEvent(FileRead.EVENT_NAME)
    void shouldFailBecauseNoFileIsRead() {
       // method to test which does not read file 
       produtionCode.doNotUseIO();
        jfrEvents.awaitEvents();
        assertThat(jfrEvents).contains(FileRead.INSTANCE);
    }

This test should fail because the method doNotUseIO in main code does not read any file so no FileRead event is recorded : the contains method should throw an AssertionError. But it does not in this case because jfrEvents.events : no event at all is recorded.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions