99import java .util .List ;
1010import java .util .Set ;
1111
12- import org .junit .Assert ;
1312import org .junit .BeforeClass ;
1413import org .junit .Test ;
1514
2120import static org .junit .Assert .assertEquals ;
2221import static org .junit .Assert .assertNotNull ;
2322import static org .junit .Assert .assertNull ;
23+ import static org .junit .Assert .assertTrue ;
2424
2525public class GlossaryTest {
2626
@@ -33,13 +33,14 @@ public static void setup() {
3333
3434 @ Test
3535 public void testGlossaryCategory () {
36- Assert . assertEquals (Glossary .Category .SOLID_TUMOR , Glossary .Category .valueOf ("SOLID_TUMOR" ));
36+ assertEquals (Glossary .Category .SOLID_TUMOR , Glossary .Category .valueOf ("SOLID_TUMOR" ));
3737 }
3838
3939 @ Test
4040 public void testGlossaryVersions () throws IOException {
4141 List <GlossaryVersion > versions = _GLOSSARY .versions ().execute ().body ();
4242
43+ assertNotNull (versions );
4344 assertEquals (1 , versions .size ());
4445 GlossaryVersion version = versions .get (0 );
4546 assertEquals ("latest" , version .getName ());
@@ -51,26 +52,27 @@ public void testGlossaryVersions() throws IOException {
5152 @ Test
5253 public void testGlossaryById () throws IOException {
5354 GlossarySearchResults results = _GLOSSARY .search ("latest" , "Lymphangiogram" ).execute ().body ();
54- Assert .assertTrue (results .getCount () > 0 );
55+ assertNotNull (results );
56+ assertTrue (results .getCount () > 0 );
5557
5658 Glossary glossary = _GLOSSARY .getById ("latest" , results .getResults ().get (0 ).getId ()).execute ().body ();
5759
58- Assert . assertNotNull (glossary );
59- Assert . assertEquals ("Lymphangiogram" , glossary .getName ());
60- Assert . assertEquals (Collections .singletonList (GENERAL ), glossary .getCategories ());
61- Assert . assertNull (glossary .getPrimarySite ());
60+ assertNotNull (glossary );
61+ assertEquals ("Lymphangiogram" , glossary .getName ());
62+ assertEquals (Collections .singletonList (GENERAL ), glossary .getCategories ());
63+ assertNull (glossary .getPrimarySite ());
6264
63- Assert . assertNull (glossary .getHistology ());
64- Assert . assertTrue (glossary .getDefinition ().startsWith ("An x-ray of the lymphatic system." ));
65- Assert . assertNull (glossary .getAlternateName ());
66- Assert . assertNull (glossary .getHistory ());
65+ assertNull (glossary .getHistology ());
66+ assertTrue (glossary .getDefinition ().startsWith ("An x-ray of the lymphatic system." ));
67+ assertNull (glossary .getAlternateName ());
68+ assertNull (glossary .getHistory ());
6769 }
6870
6971 @ Test
7072 public void testGlossaryChangelog () throws IOException {
7173 GlossaryChangelogResults results = _GLOSSARY .changelogs ("latest" , null , null , 1 ).execute ().body ();
7274
73- Assert . assertNotNull (results );
75+ assertNotNull (results );
7476
7577 // TODO since all the glossary items were removed from the production database, this needs to be commented out; it will return when they are published again
7678
@@ -104,28 +106,28 @@ public void testGlossarySearch() throws IOException {
104106
105107 GlossarySearchResults results = _GLOSSARY .search ("latest" , search .paramMap ()).execute ().body ();
106108
107- Assert . assertNotNull (results );
108- Assert . assertEquals (25 , results .getCount ().longValue ());
109- Assert . assertTrue (results .getTotal ().longValue () > 0 );
110- Assert . assertTrue (results .getResults ().size () > 0 );
111- Assert . assertEquals (Collections .singletonList (term ), results .getTerms ());
109+ assertNotNull (results );
110+ assertEquals (25 , results .getCount ().longValue ());
111+ assertTrue (results .getTotal ().longValue () > 0 );
112+ assertTrue (results .getResults ().size () > 0 );
113+ assertEquals (Collections .singletonList (term ), results .getTerms ());
112114
113115 // add the category and verify there are no results
114116 results = _GLOSSARY .search ("latest" , search .paramMap (), EnumSet .of (Glossary .Category .SOLID_TUMOR )).execute ().body ();
115117
116- Assert . assertNotNull (results );
117- Assert . assertEquals (25 , results .getCount ().longValue ());
118- Assert . assertEquals (0 , results .getTotal ().longValue ());
119- Assert . assertNull (results .getResults ());
118+ assertNotNull (results );
119+ assertEquals (25 , results .getCount ().longValue ());
120+ assertEquals (0 , results .getTotal ().longValue ());
121+ assertNull (results .getResults ());
120122
121123 // add a second category and verify there are we get the results again
122124 results = _GLOSSARY .search ("latest" , search .paramMap (), EnumSet .of (Glossary .Category .SOLID_TUMOR , Glossary .Category .HEMATO )).execute ().body ();
123125
124- Assert . assertNotNull (results );
125- Assert . assertEquals (25 , results .getCount ().longValue ());
126- Assert . assertTrue (results .getTotal ().longValue () > 0 );
127- Assert . assertTrue (results .getResults ().size () > 0 );
128- Assert . assertEquals (Collections .singletonList (term ), results .getTerms ());
126+ assertNotNull (results );
127+ assertEquals (25 , results .getCount ().longValue ());
128+ assertTrue (results .getTotal ().longValue () > 0 );
129+ assertTrue (results .getResults ().size () > 0 );
130+ assertEquals (Collections .singletonList (term ), results .getTerms ());
129131 }
130132
131133 @ Test
@@ -139,9 +141,9 @@ public void testGlossarySearchIterate() throws IOException {
139141
140142 while (total == null || search .getOffset () < total ) {
141143 GlossarySearchResults results = _GLOSSARY .search ("latest" , search .paramMap (), EnumSet .of (Glossary .Category .HEMATO )).execute ().body ();
142- Assert . assertNotNull (results );
143- Assert . assertTrue (results .getTotal () > 0 );
144- Assert . assertTrue (results .getResults ().size () > 0 );
144+ assertNotNull (results );
145+ assertTrue (results .getTotal () > 0 );
146+ assertTrue (results .getResults ().size () > 0 );
145147
146148 // the first time through, set the total
147149 if (total == null )
@@ -150,20 +152,20 @@ public void testGlossarySearchIterate() throws IOException {
150152 search .setOffset (search .getOffset () + results .getResults ().size ());
151153 }
152154
153- Assert . assertTrue (total > 100 );
155+ assertTrue (total > 100 );
154156 }
155157
156158 @ Test
157159 public void testGlossaryMatch () throws IOException {
158160 String text = "This text contains summary stage which should be found." ;
159161
160162 Set <KeywordMatch > matches = _GLOSSARY .match (text , null , true ).execute ().body ();
161- Assert . assertNotNull (matches );
162- Assert . assertEquals (1 , matches .size ());
163+ assertNotNull (matches );
164+ assertEquals (1 , matches .size ());
163165
164166 matches = _GLOSSARY .match (text , EnumSet .of (GENERAL ), true ).execute ().body ();
165- Assert . assertNotNull (matches );
166- Assert . assertEquals (0 , matches .size ());
167+ assertNotNull (matches );
168+ assertEquals (0 , matches .size ());
167169 }
168170
169171}
0 commit comments