test_class.declarator: TEST_CATALOG = "catalog"
test_class.modifier: private static final
test_class.original_string: private static final String TEST_CATALOG = "catalog";
test_class.type: String
test_class.var_name: TEST_CATALOG
test_class.declarator: TEST_TABLE = "table"
test_class.modifier: private static final
test_class.original_string: private static final String TEST_TABLE = "table";
test_class.type: String
test_class.var_name: TEST_TABLE
test_class.declarator: connection
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private Connection connection;
test_class.type: Connection
test_class.var_name: connection
test_class.declarator: databaseMetaData
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private DatabaseMetaData databaseMetaData;
test_class.type: DatabaseMetaData
test_class.var_name: databaseMetaData
test_class.declarator: indexResultSet
test_class.modifier: @Mock
      private
test_class.original_string: @Mock
      private ResultSet indexResultSet;
test_class.type: ResultSet
test_class.var_name: indexResultSet
test_class.file: shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/test/java/org/apache/shardingsphere/sql/parser/binder/metadata/index/IndexMetaDataLoaderTest.java
test_class.identifier: IndexMetaDataLoaderTest
test_case.body: @Test
      public void assertLoad() throws SQLException {
          when(databaseMetaData.getIndexInfo(TEST_CATALOG, JdbcUtil.getSchema(connection, "Mysql"), TEST_TABLE, false, false)).thenReturn(indexResultSet);
          when(indexResultSet.next()).thenReturn(true, true, false);
          when(indexResultSet.getString("INDEX_NAME")).thenReturn("my_index");
          Collection<IndexMetaData> actual = IndexMetaDataLoader.load(connection, TEST_TABLE, "Mysql");
          assertThat(actual.size(), is(1));
          IndexMetaData indexMetaData = actual.iterator().next();
          assertThat(indexMetaData.getName(), is("my_index"));
      }
test_case.class_method_signature: IndexMetaDataLoaderTest.assertLoad()
test_case.full_signature: @Test public void assertLoad()
test_case.identifier: assertLoad
test_case.invocations: thenReturn when getIndexInfo getSchema thenReturn when next thenReturn when getString load assertThat size is next iterator assertThat getName is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void assertLoad()
focal_class.declarator: INDEX_NAME = "INDEX_NAME"
focal_class.modifier: private static final
focal_class.original_string: private static final String INDEX_NAME = "INDEX_NAME";
focal_class.type: String
focal_class.var_name: INDEX_NAME
focal_class.file: shardingsphere-sql-parser/shardingsphere-sql-parser-binder/src/main/java/org/apache/shardingsphere/sql/parser/binder/metadata/index/IndexMetaDataLoader.java
focal_class.identifier: IndexMetaDataLoader
focal_class.class_method_signature: IndexMetaDataLoader.load(final Connection connection, final String table, final String databaseType)
focal_class.full_signature: public static Collection<IndexMetaData> load(final Connection connection, final String table, final String databaseType)
focal_class.identifier: load
focal_class.modifiers: public static
focal_class.parameters: (final Connection connection, final String table, final String databaseType)
focal_class.return: Collection<IndexMetaData>
focal_class.signature: Collection<IndexMetaData> load(final Connection connection, final String table, final String databaseType)
focal_method.body: public static Collection<IndexMetaData> load(final Connection connection, final String table, final String databaseType) throws SQLException {
          Collection<IndexMetaData> result = new HashSet<>();
          try (ResultSet resultSet = connection.getMetaData().getIndexInfo(connection.getCatalog(), JdbcUtil.getSchema(connection, databaseType), table, false, false)) {
              while (resultSet.next()) {
                  String indexName = resultSet.getString(INDEX_NAME);
                  if (null != indexName) {
                      result.add(new IndexMetaData(indexName));
                  }
              }
          }
          return result;
      }
focal_method.class_method_signature: IndexMetaDataLoader.load(final Connection connection, final String table, final String databaseType)
focal_method.full_signature: public static Collection<IndexMetaData> load(final Connection connection, final String table, final String databaseType)
focal_method.identifier: load
focal_method.invocations: getIndexInfo getMetaData getCatalog getSchema next getString add
focal_method.modifiers: public static
focal_method.parameters: (final Connection connection, final String table, final String databaseType)
focal_method.return: Collection<IndexMetaData>
focal_method.signature: Collection<IndexMetaData> load(final Connection connection, final String table, final String databaseType)