Skip to content

Primitive Supplier Support for assertEquals #4607

@liampace

Description

@liampace

The assertEquals functions for primitives only accepts a primitive as the result parameter. I would like to be able to pass a primitive supplier into the result argument so that we can go from something like this:

@Test
public void testExample() {
    assertEquals(123, someIntSupplier.getAsInt());
}

To something like this:

@Test
public void testExample() {
    assertEquals(123, someIntSupplier);
}

By doing this, we would be mirroring the functionality that is currently present in the assertTrue and assertFalse methods. It could be trivially implemented by making it a wrapper call for the already existing primitive assertEquals methods.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions