// Path: src/main/java/com/dsinpractice/samples/hadoop/mapred/wordcount/WCReducer.java
// public class WCReducer extends Reducer<Text, IntWritable, Text, IntWritable> {
// 
//     @Override
//     public void reduce(Text word, Iterable<IntWritable> counts, Context context)
//             throws IOException, InterruptedException {
//         int wordCount = 0;
//         for (IntWritable count : counts) {
//             wordCount += count.get();
//         }
//         context.write(word, new IntWritable(wordCount));
//     }
// }


import com.dsinpractice.samples.hadoop.mapred.wordcount.WCReducer;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mrunit.mapreduce.ReduceDriver;
import org.junit.Test;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
package com.dsinpractice.samples.hadoop.mapred.wordcount;




public class WCReducerTest {

    @Test
    public void should_add_all_values_passed_for_a_word() throws IOException, InterruptedException {

        List<IntWritable> counts = new ArrayList<IntWritable>();
        counts.add(new IntWritable(1));
        counts.add(new IntWritable(2));
        Reducer.Context context = mock(Reducer.Context.class);

// Path: src/main/java/com/dsinpractice/samples/hadoop/mapred/wordcount/WCReducer.java
// public class WCReducer extends Reducer<Text, IntWritable, Text, IntWritable> {
// 
//     @Override
//     public void reduce(Text word, Iterable<IntWritable> counts, Context context)
//             throws IOException, InterruptedException {
//         int wordCount = 0;
//         for (IntWritable count : counts) {
//             wordCount += count.get();
//         }
//         context.write(word, new IntWritable(wordCount));
//     }
// }


// Path: src/test/java/com/dsinpractice/samples/hadoop/mapred/wordcount/WCReducerTest.java
import com.dsinpractice.samples.hadoop.mapred.wordcount.WCReducer;
import org.apache.hadoop.io.IntWritable;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Reducer;
import org.apache.hadoop.mrunit.mapreduce.ReduceDriver;
import org.junit.Test;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;

package com.dsinpractice.samples.hadoop.mapred.wordcount;




public class WCReducerTest {

    @Test
    public void should_add_all_values_passed_for_a_word() throws IOException, InterruptedException {

        List<IntWritable> counts = new ArrayList<IntWritable>();
        counts.add(new IntWritable(1));
        counts.add(new IntWritable(2));
        Reducer.Context context = mock(Reducer.Context.class);

        WCReducer wcReducer = new WCReducer();