test_class.declarator: NOT_TARGET_WORD = "foobar"
test_class.modifier: private static final
test_class.original_string: private static final String NOT_TARGET_WORD = "foobar";
test_class.type: String
test_class.var_name: NOT_TARGET_WORD
test_class.declarator: contextMock
test_class.modifier: private
test_class.original_string: private Reducer.Context contextMock;
test_class.type: Reducer.Context
test_class.var_name: contextMock
test_class.declarator: reducer
test_class.modifier: private
test_class.original_string: private WordReducer reducer;
test_class.type: WordReducer
test_class.var_name: reducer
test_class.file: mapreduce/src/test/java/net/petrikainulainen/spring/data/apachehadoop/WordReducerTest.java
test_class.identifier: WordReducerTest
test_case.body: @Test
      public void reduceWhenTargetWordIsFound() throws IOException, InterruptedException {
          Text key = new Text(WordReducer.TARGET_WORD);
          Iterable<IntWritable> values = createValues(1, 1, 1);
          reducer.reduce(key, values, contextMock);
  
          ArgumentCaptor<IntWritable> countArgument = ArgumentCaptor.forClass(IntWritable.class);
  
          verify(contextMock, times(1)).write(eq(key), countArgument.capture());
          verifyNoMoreInteractions(contextMock);
  
          IntWritable count = countArgument.getValue();
          assertEquals(3, count.get());
      }
test_case.class_method_signature: WordReducerTest.reduceWhenTargetWordIsFound()
test_case.full_signature: @Test public void reduceWhenTargetWordIsFound()
test_case.identifier: reduceWhenTargetWordIsFound
test_case.invocations: createValues reduce forClass write verify times eq capture verifyNoMoreInteractions getValue assertEquals get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void reduceWhenTargetWordIsFound()
focal_class.declarator: TARGET_WORD = "Watson"
focal_class.modifier: protected static final
focal_class.original_string: protected static final String TARGET_WORD = "Watson";
focal_class.type: String
focal_class.var_name: TARGET_WORD
focal_class.file: mapreduce/src/main/java/net/petrikainulainen/spring/data/apachehadoop/WordReducer.java
focal_class.identifier: WordReducer
focal_class.class_method_signature: WordReducer.reduce(Text key, Iterable<IntWritable> values, Context context)
focal_class.full_signature: @Override protected void reduce(Text key, Iterable<IntWritable> values, Context context)
focal_class.identifier: reduce
focal_class.modifiers: @Override protected
focal_class.parameters: (Text key, Iterable<IntWritable> values, Context context)
focal_class.return: void
focal_class.signature: void reduce(Text key, Iterable<IntWritable> values, Context context)
focal_class.class_method_signature: WordReducer.containsTargetWord(Text key)
focal_class.full_signature: private boolean containsTargetWord(Text key)
focal_class.identifier: containsTargetWord
focal_class.modifiers: private
focal_class.parameters: (Text key)
focal_class.return: boolean
focal_class.signature: boolean containsTargetWord(Text key)
focal_class.superclass: extends Reducer<Text, IntWritable, Text, IntWritable>
focal_method.body: @Override
      protected void reduce(Text key, Iterable<IntWritable> values, Context context) throws IOException, InterruptedException {
          if (containsTargetWord(key)) {
              int wordCount = 0;
              for (IntWritable value: values) {
                  wordCount += value.get();
              }
              context.write(key, new IntWritable(wordCount));
          }
      }
focal_method.class_method_signature: WordReducer.reduce(Text key, Iterable<IntWritable> values, Context context)
focal_method.full_signature: @Override protected void reduce(Text key, Iterable<IntWritable> values, Context context)
focal_method.identifier: reduce
focal_method.invocations: containsTargetWord get write
focal_method.modifiers: @Override protected
focal_method.parameters: (Text key, Iterable<IntWritable> values, Context context)
focal_method.return: void
focal_method.signature: void reduce(Text key, Iterable<IntWritable> values, Context context)