test_class.file: handlebars-springmvc/src/test/java/com/github/jknack/handlebars/springmvc/MessageSourceHelperTest.java
test_class.identifier: MessageSourceHelperTest
test_case.body: @Test
    public void messageSourceWithParams() throws IOException {
      String message = "Hola";
      String code = "sayHi";
      String defaultMessage = null;
  
      // Options
      Object[] params = {1, 2, 3 };
      @SuppressWarnings("unchecked")
      Map<String, Object> hash = createMock(Map.class);
      expect(hash.get("default")).andReturn(defaultMessage);
  
      Handlebars hbs = createMock(Handlebars.class);
      Context ctx = createMock(Context.class);
      Template fn = createMock(Template.class);
  
      Options options = new Options.Builder(hbs, "messageSource", TagType.VAR, ctx, fn)
          .setParams(params)
          .setHash(hash)
          .build();
  
      MessageSource messageSource = createMock(MessageSource.class);
      expect(messageSource.getMessage(eq(code), eq(params), eq(defaultMessage),
          isA(Locale.class))).andReturn(message);
  
      replay(messageSource, hash);
  
      Object result =
          new MessageSourceHelper(messageSource).apply(code, options);
      assertEquals(message, result);
  
      verify(messageSource, hash);
    }
test_case.class_method_signature: MessageSourceHelperTest.messageSourceWithParams()
test_case.full_signature: @Test public void messageSourceWithParams()
test_case.identifier: messageSourceWithParams
test_case.invocations: createMock andReturn expect get createMock createMock createMock build setHash setParams createMock andReturn expect getMessage eq eq eq isA replay apply assertEquals verify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void messageSourceWithParams()
focal_class.declarator: messageSource
focal_class.modifier: private
focal_class.original_string: private MessageSource messageSource;
focal_class.type: MessageSource
focal_class.var_name: messageSource
focal_class.file: handlebars-springmvc/src/main/java/com/github/jknack/handlebars/springmvc/MessageSourceHelper.java
focal_class.identifier: MessageSourceHelper
focal_class.interfaces: implements Helper<String>
focal_class.class_method_signature: MessageSourceHelper.MessageSourceHelper(final MessageSource messageSource)
focal_class.full_signature: public  MessageSourceHelper(final MessageSource messageSource)
focal_class.identifier: MessageSourceHelper
focal_class.modifiers: public
focal_class.parameters: (final MessageSource messageSource)
focal_class.signature:  MessageSourceHelper(final MessageSource messageSource)
focal_class.class_method_signature: MessageSourceHelper.apply(final String code, final Options options)
focal_class.full_signature: @Override public Object apply(final String code, final Options options)
focal_class.identifier: apply
focal_class.modifiers: @Override public
focal_class.parameters: (final String code, final Options options)
focal_class.return: Object
focal_class.signature: Object apply(final String code, final Options options)
focal_class.class_method_signature: MessageSourceHelper.currentLocale()
focal_class.full_signature: protected Locale currentLocale()
focal_class.identifier: currentLocale
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: Locale
focal_class.signature: Locale currentLocale()
focal_method.body: @Override
    public Object apply(final String code, final Options options)
        throws IOException {
      Object[] args = options.params;
      String defaultMessage = options.hash("default");
      return messageSource.getMessage(code, args, defaultMessage, currentLocale());
    }
focal_method.class_method_signature: MessageSourceHelper.apply(final String code, final Options options)
focal_method.full_signature: @Override public Object apply(final String code, final Options options)
focal_method.identifier: apply
focal_method.invocations: hash getMessage currentLocale
focal_method.modifiers: @Override public
focal_method.parameters: (final String code, final Options options)
focal_method.return: Object
focal_method.signature: Object apply(final String code, final Options options)