This repository has been archived by the owner on Dec 5, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vishal Lal
committed
Nov 1, 2016
1 parent
c841e3d
commit 5daa3fc
Showing
1 changed file
with
39 additions
and
0 deletions.
There are no files selected for viewing
39 changes: 39 additions & 0 deletions
39
src/test/java/works/weave/socks/cart/controllers/UnitHealthCheckController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<String, List<HealthCheck>> results = healthCheckController.getHealth(); | ||
assertThat(results.get("health").size(), is(equalTo(2))); | ||
} | ||
} |