-
Notifications
You must be signed in to change notification settings - Fork 676
Expand file tree
/
Copy pathPersonTest.java
More file actions
40 lines (32 loc) · 1.2 KB
/
PersonTest.java
File metadata and controls
40 lines (32 loc) · 1.2 KB
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
31
32
33
34
35
36
37
38
39
40
package guru.springframework.sfgpetclinic.model;
import guru.springframework.sfgpetclinic.ModelTests;
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.RepeatedTest;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertAll;
import static org.junit.jupiter.api.Assertions.assertEquals;
class PersonTest implements ModelTests {
@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"));
}
@RepeatedTest(value = 10, name = "{displayName} : {currentRepetition} - {totalRepetitions}")
@DisplayName("My Repeated Test")
void myRepeatedTest() {
//todo - impl
}
}