Skip to content
This repository was archived by the owner on Dec 5, 2023. It is now read-only.

Commit 5daa3fc

Browse files
author
Vishal Lal
committed
Add test
1 parent c841e3d commit 5daa3fc

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
package works.weave.socks.cart.controllers;
2+
3+
import org.junit.Test;
4+
import org.junit.runner.RunWith;
5+
import org.springframework.beans.factory.annotation.Autowired;
6+
import org.springframework.context.annotation.Bean;
7+
import org.springframework.context.annotation.Configuration;
8+
import org.springframework.test.context.ContextConfiguration;
9+
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
10+
11+
import static org.hamcrest.CoreMatchers.equalTo;
12+
import static org.hamcrest.CoreMatchers.is;
13+
import static org.hamcrest.collection.IsCollectionWithSize.hasSize;
14+
import static org.hamcrest.collection.IsEmptyCollection.empty;
15+
import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder;
16+
import static org.junit.Assert.assertThat;
17+
18+
import works.weave.socks.cart.entities.HealthCheck;
19+
20+
import java.util.ArrayList;
21+
import java.util.Calendar;
22+
import java.util.Date;
23+
import java.util.HashMap;
24+
import java.util.List;
25+
import java.util.Map;
26+
27+
@RunWith(SpringJUnit4ClassRunner.class)
28+
@ContextConfiguration
29+
public class UnitHealthCheckController {
30+
31+
@Autowired
32+
private HealthCheckController healthCheckController;
33+
34+
@Test
35+
public void shouldGetHealth() {
36+
Map<String, List<HealthCheck>> results = healthCheckController.getHealth();
37+
assertThat(results.get("health").size(), is(equalTo(2)));
38+
}
39+
}

0 commit comments

Comments
 (0)