diff --git a/src/test/java/works/weave/socks/cart/controllers/UnitHealthCheckController.java b/src/test/java/works/weave/socks/cart/controllers/UnitHealthCheckController.java new file mode 100644 index 000000000..739113b8d --- /dev/null +++ b/src/test/java/works/weave/socks/cart/controllers/UnitHealthCheckController.java @@ -0,0 +1,39 @@ +package works.weave.socks.cart.controllers; + +import org.junit.Test; +import org.junit.runner.RunWith; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; +import org.springframework.test.context.ContextConfiguration; +import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.collection.IsCollectionWithSize.hasSize; +import static org.hamcrest.collection.IsEmptyCollection.empty; +import static org.hamcrest.collection.IsIterableContainingInAnyOrder.containsInAnyOrder; +import static org.junit.Assert.assertThat; + +import works.weave.socks.cart.entities.HealthCheck; + +import java.util.ArrayList; +import java.util.Calendar; +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +@RunWith(SpringJUnit4ClassRunner.class) +@ContextConfiguration +public class UnitHealthCheckController { + + @Autowired + private HealthCheckController healthCheckController; + + @Test + public void shouldGetHealth() { + Map> results = healthCheckController.getHealth(); + assertThat(results.get("health").size(), is(equalTo(2))); + } +}