Skip to content

Commit 03c928a

Browse files
Add integration test for ranking results in retrieve and rank
1 parent 7bc6a30 commit 03c928a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/src/test/java/com/ibm/watson/developer_cloud/retrieve_and_rank/v1/RetrieveAndRankIT.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,23 @@ public void testCreateRankerAndRankResults() throws InterruptedException, IOExce
140140

141141
}
142142

143+
@Test
144+
public void testRankResults() throws IOException {
145+
final File testFile = new File(RESOURCE_PATH + "ranker_test.csv");
146+
final int numToRank = 5;
147+
148+
Ranking ranking = service.rank(rankerId, testFile, numToRank).execute();
149+
assertTrue(!ranking.getAnswers().isEmpty());
150+
151+
final FileInputStream testInputStream = new FileInputStream(testFile);
152+
try {
153+
ranking = service.rank(rankerId, testInputStream, numToRank).execute();
154+
assertTrue(!ranking.getAnswers().isEmpty());
155+
} finally {
156+
testInputStream.close();
157+
}
158+
}
159+
143160
/**
144161
* Test create and delete solr cluster.
145162
*/

0 commit comments

Comments
 (0)