Skip to content

Instantly share code, notes, and snippets.

@eliasnogueira
Last active March 25, 2023 14:01
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save eliasnogueira/bc1e3e5b92245b77d53ff5dcd20811e4 to your computer and use it in GitHub Desktop.
HardAssertion: JUnit 5
import org.assertj.core.api.SoftAssertions;
import org.junit.jupiter.api.Test;
class HardAssertionTest {
@Test
void hardAssertion() {
var person = Person.builder().name("John").phoneNumber(null).age(16).build();
assertThat(person.getName()).isNotBlank();
assertThat(person.getPhoneNumber()).isNotNull();
assertThat(person.getAge()).isGreaterThan(18);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment