class KafkaSenderExporter {

  @Activate
  public void activate(Config config, BundleContext context, Map<String, String> properties) {
    sender = KafkaSender.newBuilder()
        .bootstrapServers(config.bootstrapServers())
        .encoding(config.encoding())
        .messageMaxBytes(config.messageMaxBytes())
        .overrides(getOverrides(properties))
        .topic(config.topic())
        .build();
    reg = context.registerService(Sender.class, sender, new Hashtable<String, String>(properties));
  }

}

class KafkaSenderExporterTest {

  @Test
  public void testConfig() {

    KafkaSenderExporter exporter = new KafkaSenderExporter();
    Map<String, String> properties = new HashMap<String, String>();
    properties.put("kafka.myprop", "myvalue");
    BundleContext context = mock(BundleContext.class);
    Config config = mock(Config.class);
    when(config.bootstrapServers()).thenReturn("server1");
    when(config.encoding()).thenReturn(Encoding.JSON);
    when(config.topic()).thenReturn("mytopic");
    exporter.activate(config, context, properties);
  }

}