-
Notifications
You must be signed in to change notification settings - Fork 676
Expand file tree
/
Copy pathPersonTest.java
More file actions
30 lines (23 loc) · 809 Bytes
/
PersonTest.java
File metadata and controls
30 lines (23 loc) · 809 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package guru.springframework.sfgpetclinic.model;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.*;
class PersonTest {
@Test
void groupedAssertions() {
//given
Person person = new Person(1l, "Joe", "Buck");
//then
assertAll("Test Props Set",
() -> assertEquals(person.getFirstName(), "Joe"),
() -> assertEquals(person.getLastName(), "Buck"));
}
@Test
void groupedAssertionMsgs() {
//given
Person person = new Person(1l, "Joe", "Buck");
//then
assertAll("Test Props Set",
() -> assertEquals(person.getFirstName(), "Joe", "First Name Failed"),
() -> assertEquals(person.getLastName(), "Buck", "Last Name Failed"));
}
}