assertj-vavr icon indicating copy to clipboard operation
assertj-vavr copied to clipboard

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

Open torstenmandry opened this issue 8 months ago • 0 comments

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?

torstenmandry avatar Jun 06 '24 16:06 torstenmandry