@Test
public void hiveMetastoreShouldStart() throws InterruptedException, NotFoundServiceException {

    Assertions.assertThat(Utils.available("127.0.0.1", 20102)).isFalse();
    // Create a table and display it back
    try {
        HiveMetaStoreClient hiveClient = new HiveMetaStoreClient((HiveConf) ((BootstrapHadoop) HadoopBootstrap.INSTANCE.getService("HIVEMETA")).getConfiguration());
        hiveClient.dropTable(configuration.getString(HiveConfig.HIVE_TEST_DATABASE_NAME_KEY),
                configuration.getString(HiveConfig.HIVE_TEST_TABLE_NAME_KEY),
                true,
                true);
        // Define the cols
        List<FieldSchema> cols = new ArrayList<>();
        cols.add(new FieldSchema("id", serdeConstants.INT_TYPE_NAME, ""));
        cols.add(new FieldSchema("msg", serdeConstants.STRING_TYPE_NAME, ""));
        // Values for the StorageDescriptor
        String location = new File(configuration.getString(HiveConfig.HIVE_TEST_TABLE_NAME_KEY)).getAbsolutePath();
        String inputFormat = "org.apache.hadoop.hive.ql.io.orc.OrcInputFormat";
        String outputFormat = "org.apache.hadoop.hive.ql.io.orc.OrcOutputFormat";
        int numBuckets = 16;
        Map<String, String> orcProps = new HashMap<>();
        orcProps.put("orc.compress", "NONE");
        SerDeInfo serDeInfo = new SerDeInfo(OrcSerde.class.getSimpleName(), OrcSerde.class.getName(), orcProps);
        List<String> bucketCols = new ArrayList<>();
        bucketCols.add("id");
        // Build the StorageDescriptor
        StorageDescriptor sd = new StorageDescriptor();
        sd.setCols(cols);
        sd.setLocation(location);
        sd.setInputFormat(inputFormat);
        sd.setOutputFormat(outputFormat);
        sd.setNumBuckets(numBuckets);
        sd.setSerdeInfo(serDeInfo);
        sd.setBucketCols(bucketCols);
        sd.setSortCols(new ArrayList<>());
        sd.setParameters(new HashMap<>());
        // Define the table
        Table tbl = new Table();
        tbl.setDbName(configuration.getString(HiveConfig.HIVE_TEST_DATABASE_NAME_KEY));
        tbl.setTableName(configuration.getString(HiveConfig.HIVE_TEST_TABLE_NAME_KEY));
        tbl.setSd(sd);
        tbl.setOwner(System.getProperty("user.name"));
        tbl.setParameters(new HashMap<>());
        tbl.setViewOriginalText("");
        tbl.setViewExpandedText("");
        tbl.setTableType(TableType.EXTERNAL_TABLE.name());
        List<FieldSchema> partitions = new ArrayList<FieldSchema>();
        partitions.add(new FieldSchema("dt", serdeConstants.STRING_TYPE_NAME, ""));
        tbl.setPartitionKeys(partitions);
        // Create the table
        hiveClient.createTable(tbl);
        // Describe the table
        Table createdTable = hiveClient.getTable(
                configuration.getString(HiveConfig.HIVE_TEST_DATABASE_NAME_KEY),
                configuration.getString(HiveConfig.HIVE_TEST_TABLE_NAME_KEY));
        assertThat(createdTable.toString()).contains(configuration.getString(HiveConfig.HIVE_TEST_TABLE_NAME_KEY));
    } catch (MetaException e) {
        e.printStackTrace();
    } catch (TException e) {
        e.printStackTrace();
    }
}