-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathLibertyAppSmokeIT.java
More file actions
43 lines (33 loc) · 1.14 KB
/
LibertyAppSmokeIT.java
File metadata and controls
43 lines (33 loc) · 1.14 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
41
42
43
package org.example.app;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.microshed.testing.health.Health;
import static org.hamcrest.CoreMatchers.is;
import static org.junit.Assert.assertThat;
/**
* Requires an local environment which is already running.
* Thus enables to decouple the life cycles of the tests and results in a smaller turnaround time.
* <p>
* Note that this is a different approach to {@link LibertySmokeIT}.
*/
public class LibertyAppSmokeIT {
private TestApplication application;
@BeforeEach
void setUp() {
application = new TestApplication();
}
@Test
void testIsSystemUp() {
assertThat(application.health().status, is(org.microshed.testing.health.Health.Status.UP));
assertThat(application.health().getCheck("test-app").status, is(Health.Status.UP));
}
@Test
void testGetAllPeople() {
assertThat(application.getAllPeople().size(), is(2));
}
@Test
void testGetPerson() {
Person person = application.getAllPeople().iterator().next();
assertThat(application.getPerson(person.id), is(person));
}
}