Skip to content

Path assertion endsWith throws NoSuchFileException on non-existing file #3840

@bekoenig

Description

@bekoenig
  • assertj core version: 3.27.3
  • java version: 17
  • test framework version: junit-jupiter
  • os (if relevant): Windows

AbstractPathAssert#endsWith throws NoSuchFileException on non existing file. This behaviour is unexpected between endsWith and endsWithRaw.

Path actual = Path.of("somewhere/over/the/rainbow");
Path tail = Path.of("rainbow");

@Test
void successful() {
    assertThat(actual).endsWithRaw(tail);
}

@Test
void fails() {
    assertThat(actual).endsWith(tail);
}

I can contribute a bugfix 👍!

Metadata

Metadata

Assignees

Labels

No fields configured for 🐛 Bug.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions