-
Notifications
You must be signed in to change notification settings - Fork 673
Expand file tree
/
Copy pathOwnerTest.java
More file actions
29 lines (22 loc) · 995 Bytes
/
OwnerTest.java
File metadata and controls
29 lines (22 loc) · 995 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
package guru.springframework.sfgpetclinic.model;
import org.junit.jupiter.api.Test;
import static org.hamcrest.MatcherAssert.assertThat;
import static org.hamcrest.Matchers.is;
import static org.junit.jupiter.api.Assertions.*;
class OwnerTest {
@Test
void dependentAssertions() {
Owner owner = new Owner(1l, "Joe", "Buck");
owner.setCity("Key West");
owner.setTelephone("1231231234");
assertAll("Properties Test",
() -> assertAll("Person Properties",
() -> assertEquals("Joe", owner.getFirstName(), "First Name Did not Match"),
() -> assertEquals("Buck", owner.getLastName())),
() -> assertAll("Owner Properties",
() -> assertEquals("Key West", owner.getCity(), "City Did Not Match"),
() -> assertEquals("1231231234", owner.getTelephone())
));
assertThat(owner.getCity(), is("Key West"));
}
}