test_class.declarator: metric = new MetricRegistry()
test_class.modifier: @Spy
      private
test_class.original_string: @Spy
      private MetricRegistry metric = new MetricRegistry();
test_class.type: MetricRegistry
test_class.var_name: metric
test_class.declarator: listener = new AntennaListener(mock(Dispatcher.class), new Gson(), metric)
test_class.modifier: @InjectMocks
      private
test_class.original_string: @InjectMocks
      private AntennaListener listener = new AntennaListener(mock(Dispatcher.class), new Gson(), metric);
test_class.type: AntennaListener
test_class.var_name: listener
test_class.file: antenna/src/test/java/com/oneops/antenna/jms/AntennaListenerTest.java
test_class.identifier: AntennaListenerTest
test_case.body: @Test
      public void onBadMessage() {
          TextMessage mockMessage = mock(TextMessage.class);
  
          try {
              when(mockMessage.getText()).thenReturn(""); //not good json
          } catch (JMSException e) {
              ;//swallow it is the mock
          }
          this.listener.onMessage(mockMessage);//method does not throw anything it is ok
  
      }
test_case.class_method_signature: AntennaListenerTest.onBadMessage()
test_case.full_signature: @Test public void onBadMessage()
test_case.identifier: onBadMessage
test_case.invocations: mock thenReturn when getText onMessage
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void onBadMessage()
focal_class.declarator: logger = Logger.getLogger(AntennaListener.class)
focal_class.modifier: private static
focal_class.original_string: private static Logger logger = Logger.getLogger(AntennaListener.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: dmlc
focal_class.modifier: private
focal_class.original_string: private DefaultMessageListenerContainer dmlc;
focal_class.type: DefaultMessageListenerContainer
focal_class.var_name: dmlc
focal_class.declarator: dispatcher
focal_class.modifier: private
focal_class.original_string: private Dispatcher dispatcher;
focal_class.type: Dispatcher
focal_class.var_name: dispatcher
focal_class.declarator: gson
focal_class.modifier: private
focal_class.original_string: private Gson gson;
focal_class.type: Gson
focal_class.var_name: gson
focal_class.declarator: metrics
focal_class.modifier: private
focal_class.original_string: private MetricRegistry metrics;
focal_class.type: MetricRegistry
focal_class.var_name: metrics
focal_class.declarator: msgs
focal_class.modifier: private
focal_class.original_string: private Meter msgs;
focal_class.type: Meter
focal_class.var_name: msgs
focal_class.declarator: msgTime
focal_class.modifier: private
focal_class.original_string: private Timer msgTime;
focal_class.type: Timer
focal_class.var_name: msgTime
focal_class.file: antenna/src/main/java/com/oneops/antenna/jms/AntennaListener.java
focal_class.identifier: AntennaListener
focal_class.interfaces: implements MessageListener
focal_class.class_method_signature: AntennaListener.AntennaListener(Dispatcher dispatcher,
                             Gson gson,
                             MetricRegistry metrics)
focal_class.full_signature: @Autowired public  AntennaListener(Dispatcher dispatcher,
                             Gson gson,
                             MetricRegistry metrics)
focal_class.identifier: AntennaListener
focal_class.modifiers: @Autowired public
focal_class.parameters: (Dispatcher dispatcher,
                             Gson gson,
                             MetricRegistry metrics)
focal_class.signature:  AntennaListener(Dispatcher dispatcher,
                             Gson gson,
                             MetricRegistry metrics)
focal_class.class_method_signature: AntennaListener.setDmlc(DefaultMessageListenerContainer dmlc)
focal_class.full_signature: @Autowired public void setDmlc(DefaultMessageListenerContainer dmlc)
focal_class.identifier: setDmlc
focal_class.modifiers: @Autowired public
focal_class.parameters: (DefaultMessageListenerContainer dmlc)
focal_class.return: void
focal_class.signature: void setDmlc(DefaultMessageListenerContainer dmlc)
focal_class.class_method_signature: AntennaListener.init()
focal_class.full_signature: @PostConstruct public void init()
focal_class.identifier: init
focal_class.modifiers: @PostConstruct public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void init()
focal_class.class_method_signature: AntennaListener.metricInit()
focal_class.full_signature: private void metricInit()
focal_class.identifier: metricInit
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void metricInit()
focal_class.class_method_signature: AntennaListener.onMessage(Message msg)
focal_class.full_signature: public void onMessage(Message msg)
focal_class.identifier: onMessage
focal_class.modifiers: public
focal_class.parameters: (Message msg)
focal_class.return: void
focal_class.signature: void onMessage(Message msg)
focal_class.class_method_signature: AntennaListener.parseMsg(TextMessage message)
focal_class.full_signature: private NotificationMessage parseMsg(TextMessage message)
focal_class.identifier: parseMsg
focal_class.modifiers: private
focal_class.parameters: (TextMessage message)
focal_class.return: NotificationMessage
focal_class.signature: NotificationMessage parseMsg(TextMessage message)
focal_class.class_method_signature: AntennaListener.toString()
focal_class.full_signature: @Override public String toString()
focal_class.identifier: toString
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String toString()
focal_method.body: public void onMessage(Message msg) {
          msgs.mark();
          Context tc = msgTime.time();
          try {
              NotificationMessage notify = null;
              if (msg instanceof TextMessage) {
                  try {
                      notify = parseMsg((TextMessage) msg);
                  } catch (JsonParseException e) {
                      logger.error("Got the bad message, not a valid json format - \n"
                              + ((TextMessage) msg).getText() + "\n" + e.getMessage());
                      msg.acknowledge();
                  }
              } else if (msg instanceof ObjectMessage) {
                  notify = (NotificationMessage) ((ObjectMessage) msg).getObject();
              }
              if (notify != null) {
                  logger.debug("Notification message received: " + notify.getText());
                  if (notify.getTimestamp() == 0) {
                      notify.setTimestamp(System.currentTimeMillis());
                  }
                  dispatcher.dispatch(notify);
              }
              msg.acknowledge();
  
          } catch (Exception ex) {
              logger.error("Can't process the notification message.", ex);
          } finally {
              tc.stop();
          }
      }
focal_method.class_method_signature: AntennaListener.onMessage(Message msg)
focal_method.full_signature: public void onMessage(Message msg)
focal_method.identifier: onMessage
focal_method.invocations: mark time parseMsg error getText getMessage acknowledge getObject debug getText getTimestamp setTimestamp currentTimeMillis dispatch acknowledge error stop
focal_method.modifiers: public
focal_method.parameters: (Message msg)
focal_method.return: void
focal_method.signature: void onMessage(Message msg)