public static Config loadConfig(File file) throws IOException {
        return mapper.readValue(file, Config.class);
    }
@Test
    public void testLoadDefaultConfig() throws URISyntaxException, IOException {
        final URL url = getClass().getClassLoader().getResource("kop_required.yaml");
        assertNotNull(url);

        final Config config = KopBenchmarkDriver.loadConfig(new File(url.toURI()));
        assertEquals(config.producerType, ClientType.PULSAR);
        assertEquals(config.consumerType, ClientType.KAFKA);
        assertEquals(config.pollTimeoutMs, 100);

        final PulsarConfig pulsarConfig = config.pulsarConfig;
        assertEquals(pulsarConfig.serviceUrl, "pulsar://localhost:6650");
        assertTrue(pulsarConfig.batchingEnabled);
        assertEquals(pulsarConfig.batchingMaxPublishDelayMs, 1);
        assertEquals(pulsarConfig.batchingMaxBytes, 131072);
        assertTrue(pulsarConfig.blockIfQueueFull);
        assertEquals(pulsarConfig.pendingQueueSize, 1000);
        assertEquals(pulsarConfig.maxPendingMessagesAcrossPartitions, 50000);
        assertEquals(pulsarConfig.maxTotalReceiverQueueSizeAcrossPartitions, 50000);
        assertEquals(pulsarConfig.receiverQueueSize, 1000);

        assertEquals(config.getKafkaProperties().get("bootstrap.servers"), "localhost:9092");
    }