Commit aa2535bf authored by Ricco Førgaard's avatar Ricco Førgaard

Added another test and some correct data.

parent af3ec8ca
...@@ -2,6 +2,8 @@ package com.nesstar.tutorial; ...@@ -2,6 +2,8 @@ package com.nesstar.tutorial;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import java.util.Locale;
import org.junit.Test; import org.junit.Test;
import com.nesstar.api.Server; import com.nesstar.api.Server;
...@@ -26,4 +28,16 @@ public class Level01 { ...@@ -26,4 +28,16 @@ public class Level01 {
assertEquals("nina", server.getId()); assertEquals("nina", server.getId());
} }
/**
* Set the preferred language to English.
*/
@Test
public void setPreferredLanguage() {
Server server = null;
Locale primaryLanguage = null;
assertEquals(primaryLanguage.getLanguage(), "en");
}
} }
...@@ -38,8 +38,8 @@ public class Level02 { ...@@ -38,8 +38,8 @@ public class Level02 {
} }
/** /**
* Do a simple search for the term "employment". It should * Do a simple search for the term "vegetables". It should
* return 1 study. * return 2 hits.
* *
*/ */
@Test @Test
...@@ -47,8 +47,10 @@ public class Level02 { ...@@ -47,8 +47,10 @@ public class Level02 {
SearchQuery query = new SearchQuery(); SearchQuery query = new SearchQuery();
SearchResult result = null; SearchResult result = null;
assertEquals(1, result.getListOfHits()); List<SearchResultItem> hits = result.getListOfHits();
assertEquals("some studylabel here", result.getListOfHits().get(0).getLabel()); assertEquals(2, hits.size());
SearchResultItem<NesstarObject> object = hits.get(0);
assertEquals("How often: eat fruit or vegetables", object.getLabel());
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment