Skip to content
This repository has been archived by the owner on Jun 19, 2024. It is now read-only.

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
fayderflorez committed Dec 4, 2013
1 parent 51975da commit 617649d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/main/webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ <h3> Country Code</h3>
<div class="col-lg-4">
<h3> Country Codes</h3>
<div class="input-group">
<a id="rc-a-alpha2" class="btn btn-default rc-a-tryit">http://localhost:8081/rest/alpha?codes=de;fra;fi</a>
<a id="rc-a-alpha2" class="btn btn-default rc-a-tryit">http://localhost:8081/rest/alpha?codes=co;rus;no</a>
</div>
</div>
<div id="rc-div-diy" class="col-lg-11" style="margin-top: 10px; margin-bottom: 10px; text-align: center;">
Expand Down
11 changes: 11 additions & 0 deletions src/test/java/vaeke/countrydata/rest/CountryRestTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,17 @@ public void alphaList() {
org.junit.Assert.assertTrue(response.getBody().contains("\"alpha2Code\":\"IT\""));
}

@HttpTest(method = Method.GET, path = "/name/russia")
public void name() {
Assert.assertOk(response);
List<Country> countries = deserializeList(response.getBody());
org.junit.Assert.assertFalse(countries.isEmpty());
for(Country c : countries) {
org.junit.Assert.assertEquals("Russia", c.getName());
}

}

private List<Country> deserializeList(String json) {
Gson gson = new Gson();
Type listType = new TypeToken<ArrayList<Country>>() {}.getType();
Expand Down

0 comments on commit 617649d

Please sign in to comment.