test_class.declarator: connectionFactory
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ConnectionFactory connectionFactory;
test_class.type: ConnectionFactory
test_class.var_name: connectionFactory
test_class.declarator: healthChecker = new JmsConnectionHealthChecker()
test_class.modifier: private
test_class.original_string: private JmsConnectionHealthChecker healthChecker = new JmsConnectionHealthChecker();
test_class.type: JmsConnectionHealthChecker
test_class.var_name: healthChecker
test_class.file: infrastructure/metrics-jsr340/src/test/java/de/qaware/oss/metrics/jsr340/JmsConnectionHealthCheckerTest.java
test_class.identifier: JmsConnectionHealthCheckerTest
test_case.body: @Test
      public void checkUnhealthyCloseConnection() throws Exception {
          Connection connectionMock = Mockito.mock(Connection.class);
          doThrow(new JMSException("")).when(connectionMock).close();
          when(connectionFactory.createConnection()).thenReturn(connectionMock);
          assertThat(healthChecker.check(connectionFactory).isHealthy(), is(false));
      }
test_case.class_method_signature: JmsConnectionHealthCheckerTest.checkUnhealthyCloseConnection()
test_case.full_signature: @Test public void checkUnhealthyCloseConnection()
test_case.identifier: checkUnhealthyCloseConnection
test_case.invocations: mock close when doThrow thenReturn when createConnection assertThat isHealthy check is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void checkUnhealthyCloseConnection()
focal_class.file: infrastructure/metrics-jsr340/src/main/java/de/qaware/oss/metrics/jsr340/JmsConnectionHealthChecker.java
focal_class.identifier: JmsConnectionHealthChecker
focal_class.class_method_signature: JmsConnectionHealthChecker.check(ConnectionFactory connectionFactory)
focal_class.full_signature: public Result check(ConnectionFactory connectionFactory)
focal_class.identifier: check
focal_class.modifiers: public
focal_class.parameters: (ConnectionFactory connectionFactory)
focal_class.return: Result
focal_class.signature: Result check(ConnectionFactory connectionFactory)
focal_method.body: public Result check(ConnectionFactory connectionFactory) {
          try (Connection connection = connectionFactory.createConnection()) {
              if (connection == null) {
                  return Result.unhealthy("No connection could be established");
              }
              connection.start();
              return Result.healthy();
          } catch (JMSException e) {
              return Result.unhealthy(e);
          }
      }
focal_method.class_method_signature: JmsConnectionHealthChecker.check(ConnectionFactory connectionFactory)
focal_method.full_signature: public Result check(ConnectionFactory connectionFactory)
focal_method.identifier: check
focal_method.invocations: createConnection unhealthy start healthy unhealthy
focal_method.modifiers: public
focal_method.parameters: (ConnectionFactory connectionFactory)
focal_method.return: Result
focal_method.signature: Result check(ConnectionFactory connectionFactory)