@Test
@FixFor("DBZ-1015")
public void customKeyMapperShouldMapMultipleTables() {

    TableId id2 = new TableId("catalog", "schema", "table2");
    Table table2 = Table.editor()
            .tableId(id2)
            .addColumns(Column.editor().name("C1")
                    .type("VARCHAR").jdbcType(Types.VARCHAR).length(10)
                    .optional(false)
                    .create(),
                    Column.editor().name("C2")
                            .type("NUMBER").jdbcType(Types.NUMERIC).length(5).scale(3)
                            .create(),
                    Column.editor().name("C3")
                            .type("DATE").jdbcType(Types.DATE).length(4)
                            .optional(true)
                            .create())
            .create();
    KeyMapper keyMapper = CustomKeyMapper.getInstance("(.*).table:C2,C3;(.*).table2:C1", null);
    schema = new TableSchemaBuilder(new JdbcValueConverters(), adjuster, customConverterRegistry, SchemaBuilder.struct().build(), false)
            .create(prefix, "sometopic", table, null, null, keyMapper);
    assertThat(schema).isNotNull();
    Schema keys = schema.keySchema();
    assertThat(keys).isNotNull();
    assertThat(keys.fields()).hasSize(2);
    assertThat(keys.field("C1")).isNull();
    assertThat(keys.field("C2").name()).isEqualTo("C2");
    assertThat(keys.field("C3").name()).isEqualTo("C3");
    TableSchema schema2 = new TableSchemaBuilder(new JdbcValueConverters(), adjuster, customConverterRegistry, SchemaBuilder.struct().build(), false)
            .create(prefix, "sometopic", table2, null, null, keyMapper);
    assertThat(schema2).isNotNull();
    Schema key2 = schema2.keySchema();
    assertThat(key2).isNotNull();
    assertThat(key2.fields()).hasSize(1);
    assertThat(key2.field("C1").name()).isEqualTo("C1");
}