DBZ-620 Removing method only used in tests
This commit is contained in:
parent
ab11f48843
commit
5bc62dc862
@ -63,23 +63,6 @@ public TableSchemaBuilder(ValueConverterProvider valueConverterProvider, Functio
|
||||
this.sourceInfoSchema = sourceInfoSchema;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link TableSchema} from the given {@link Table table definition}. The resulting TableSchema will have a
|
||||
* {@link TableSchema#keySchema() key schema} that contains all of the columns that make up the table's primary key,
|
||||
* and a {@link TableSchema#valueSchema() value schema} that contains only those columns that are not in the table's primary
|
||||
* key.
|
||||
* <p>
|
||||
* This is equivalent to calling {@code create(table,false)}.
|
||||
*
|
||||
* @param schemaPrefix the prefix added to the table identifier to construct the schema names; may be null if there is no
|
||||
* prefix
|
||||
* @param table the table definition; may not be null
|
||||
* @return the table schema that can be used for sending rows of data for this table to Kafka Connect; never null
|
||||
*/
|
||||
public TableSchema create(String schemaPrefix, String envelopeSchemaName, Table table) {
|
||||
return create(schemaPrefix, envelopeSchemaName, table, null, null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a {@link TableSchema} from the given {@link Table table definition}. The resulting TableSchema will have a
|
||||
* {@link TableSchema#keySchema() key schema} that contains all of the columns that make up the table's primary key,
|
||||
|
@ -95,19 +95,22 @@ public void checkPreconditions() {
|
||||
|
||||
@Test(expected = NullPointerException.class)
|
||||
public void shouldFailToBuildTableSchemaFromNullTable() {
|
||||
new TableSchemaBuilder(new JdbcValueConverters(),validator::validate, SchemaBuilder.struct().build()).create(prefix, "sometopic", null);
|
||||
new TableSchemaBuilder(new JdbcValueConverters(), validator::validate, SchemaBuilder.struct().build())
|
||||
.create(prefix, "sometopic", null, null, null);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldBuildTableSchemaFromTable() {
|
||||
schema = new TableSchemaBuilder(new JdbcValueConverters(),validator::validate, SchemaBuilder.struct().build()).create(prefix, "sometopic", table);
|
||||
schema = new TableSchemaBuilder(new JdbcValueConverters(), validator::validate, SchemaBuilder.struct().build())
|
||||
.create(prefix, "sometopic", table, null, null);
|
||||
assertThat(schema).isNotNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldBuildTableSchemaFromTableWithoutPrimaryKey() {
|
||||
table = table.edit().setPrimaryKeyNames().create();
|
||||
schema = new TableSchemaBuilder(new JdbcValueConverters(),validator::validate, SchemaBuilder.struct().build()).create(prefix, "sometopic", table);
|
||||
schema = new TableSchemaBuilder(new JdbcValueConverters(), validator::validate, SchemaBuilder.struct().build())
|
||||
.create(prefix, "sometopic", table, null, null);
|
||||
assertThat(schema).isNotNull();
|
||||
// Check the keys ...
|
||||
assertThat(schema.keySchema()).isNull();
|
||||
|
Loading…
Reference in New Issue
Block a user