/** * Builds up the CDC event schema for the given table and stores it in this schema. */ protected void buildAndRegisterSchema(Table table) { if (tableFilter.isIncluded(table.id())) { TableSchema schema = schemaBuilder.create(schemaPrefix, getEnvelopeSchemaName(table), table, columnFilter, columnMappers); schemasByTableId.put(table.id(), schema); } }
@Test(expected = NullPointerException.class) public void shouldFailToBuildTableSchemaFromNullTable() { new TableSchemaBuilder(new JdbcValueConverters(), adjuster, SchemaBuilder.struct().build()) .create(prefix, "sometopic", null, null, null); }
@Test public void shouldBuildTableSchemaFromTable() { schema = new TableSchemaBuilder(new JdbcValueConverters(), adjuster, SchemaBuilder.struct().build()) .create(prefix, "sometopic", table, null, null); assertThat(schema).isNotNull(); }
table = table.edit().setPrimaryKeyNames().create(); schema = new TableSchemaBuilder(new JdbcValueConverters(), adjuster, SchemaBuilder.struct().build()) .create(prefix, "sometopic", table, null, null); assertThat(schema).isNotNull();
/** * Builds up the CDC event schema for the given table and stores it in this schema. */ protected void buildAndRegisterSchema(Table table) { if (tableFilter.isIncluded(table.id())) { TableSchema schema = schemaBuilder.create(schemaPrefix, getEnvelopeSchemaName(table), table, columnFilter, columnMappers); schemasByTableId.put(table.id(), schema); } }