@Test public void testRecommendVersusToMany2() throws Exception { ServerRecommender client = getRecommender(); List<IDValue> recs = client.recommendToMany(new String[] {"4", "2"}, 3, true, null); List<IDValue> recs2 = client.recommendToMany(new String[] {"2", "4"}, 3, true, null); assertEquals(recs, recs2); }
@Test public void testRecommendToMany2() throws Exception { ServerRecommender client = getRecommender(); List<IDValue> recs = client.recommendToMany(new String[] {"3", "4", "5", "6", "7"}, 3, true, null); assertNotNull(recs); assertEquals(3, recs.size()); log.info("{}", recs); assertEquals("50", recs.get(0).getID()); assertEquals("258", recs.get(1).getID()); assertEquals("288", recs.get(2).getID()); }
@Test public void testRecommendToMany() throws Exception { ServerRecommender client = getRecommender(); // Adding non-existent item to make sure it is ignored List<IDValue> recs = client.recommendToMany(new String[] {"1", "3", "ABC"}, 3, false, null); assertNotNull(recs); assertEquals(3, recs.size()); log.info("{}", recs); assertEquals("286", recs.get(0).getID()); assertEquals("288", recs.get(1).getID()); assertEquals("302", recs.get(2).getID()); }