AssertJ — fluent assertions, читабельнее JUnit. assertThat(list).hasSize(3).contains("a", "b").doesNotContain("x"). assertThat(user.getName()).isEqualTo("John").startsWith("Jo"). assertThat(exception).isInstanceOf(IllegalArgumentException.class).hasMessageContaining("invalid"). assertThat(list).extracting(User::getName).containsExactly("Alice", "Bob"). Soft assertions — проверить всё и показать все ошибки: SoftAssertions.assertSoftly(soft -> { soft.assertThat(...); }). assertThatThrownBy(() -> ...).isInstanceOf(...).
Как тестировать с AssertJ?
Junior
313 просмотровAFK Offer AI
Как написать хорошие интеграционные тесты в Spring Boot?