Skip to content

Instantly share code, notes, and snippets.

@eliasnogueira
Last active March 25, 2023 14:01
Embed
What would you like to do?
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