/** * tests {@link org.apache.mahout.cf.taste.hadoop.item.ItemFilterAsVectorAndPrefsReducer} */ @Test public void testItemFilterAsVectorAndPrefsReducer() throws Exception { Reducer<VarLongWritable,VarLongWritable,VarIntWritable,VectorAndPrefsWritable>.Context context = EasyMock.createMock(Reducer.Context.class); int itemIDIndex = TasteHadoopUtils.idToIndex(123L); context.write(EasyMock.eq(new VarIntWritable(itemIDIndex)), vectorAndPrefsForFilteringMatches(123L, 456L, 789L)); EasyMock.replay(context); new ItemFilterAsVectorAndPrefsReducer().reduce(new VarLongWritable(123L), Arrays.asList(new VarLongWritable(456L), new VarLongWritable(789L)), context); EasyMock.verify(context); }