Skip to content

assertThat(Map).containsEntry(...) throws NoSuchMethodError with AssertJ 3.25 #216

@torstenmandry

Description

@torstenmandry

We're using assertj-vavr for various assertions in our spring-boot project.

With the recently published spring-boot version 3.3.0 the managed assertj version was updated to 3.25.0.

With this update, when running a test like

@Test
void assertThatMapContainsEntry() {
    VavrAssertions.assertThat(HashMap.of("key", "value"))
            .containsEntry("key", "value");
}

the following exception is thrown

java.lang.NoSuchMethodError: 'void org.assertj.core.internal.CommonValidations.failIfEmptySinceActualIsNotEmpty(java.lang.Object[])'
	at org.assertj.vavr.internal.Maps.assertContains(Maps.java:117)
	at org.assertj.vavr.api.AbstractMapAssert.containsEntry(AbstractMapAssert.java:172)
	at ...

It looks like the latest assertj-vavr release (0.4.3) ist not compatible with assertj 3.25.0.

Although, in the commit history of this git repository I can see, that there were updates to assertj-core 3.25 and higher. Maybe it's just a new release that is missing?

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions