Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update Checkstyle version and fix errors #304

Merged
merged 1 commit into from
Apr 30, 2024

Conversation

jjaakola-aiven
Copy link
Contributor

No description provided.

@jjaakola-aiven jjaakola-aiven requested review from a team as code owners April 29, 2024 12:11
Comment on lines 78 to 93
@Test
public void testValidateTablesGiven() {
final Map<String, String> properties = new HashMap<>();
properties.put(JdbcSourceTaskConfig.TABLES_CONFIG, "test-table");
properties.put(JdbcConfig.CONNECTION_URL_CONFIG, "connection-url");
properties.put(JdbcSourceConnectorConfig.MODE_CONFIG, "bulk");
properties.put(JdbcSourceConnectorConfig.TOPIC_PREFIX_CONFIG, "test-prefix");
final JdbcSourceTaskConfig config = new JdbcSourceTaskConfig(properties);
config.validate();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since its a list I would add in the test also a test regarding the retrieval of the values, something like:

Suggested change
@Test
public void testValidateTablesGiven() {
final Map<String, String> properties = new HashMap<>();
properties.put(JdbcSourceTaskConfig.TABLES_CONFIG, "test-table");
properties.put(JdbcConfig.CONNECTION_URL_CONFIG, "connection-url");
properties.put(JdbcSourceConnectorConfig.MODE_CONFIG, "bulk");
properties.put(JdbcSourceConnectorConfig.TOPIC_PREFIX_CONFIG, "test-prefix");
final JdbcSourceTaskConfig config = new JdbcSourceTaskConfig(properties);
config.validate();
}
@Test
public void testValidateTablesGiven() {
final Map<String, String> properties = new HashMap<>();
properties.put(JdbcSourceTaskConfig.TABLES_CONFIG, "test-table1, test-table2");
properties.put(JdbcConfig.CONNECTION_URL_CONFIG, "connection-url");
properties.put(JdbcSourceConnectorConfig.MODE_CONFIG, "bulk");
properties.put(JdbcSourceConnectorConfig.TOPIC_PREFIX_CONFIG, "test-prefix");
final JdbcSourceTaskConfig config = new JdbcSourceTaskConfig(properties);
config.validate();
assertEquals(config.getList(JdbcSourceTaskConfig.TABLES_CONFIG), List.of("test-table1", "test-table2"));
}

@@ -31,11 +33,23 @@ public class JdbcSourceTaskConfig extends JdbcSourceConnectorConfig {

public static final String TABLES_CONFIG = "tables";
private static final String TABLES_DOC = "List of tables for this task to watch for changes.";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to add: encoded as a comma separated string

Copy link
Contributor

@eliax1996 eliax1996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To me looks fine, if you wanna add the suggestion I'm happier, not mandatory. I can merge as it is if you prefer

@jjaakola-aiven jjaakola-aiven force-pushed the jjaakola-aiven-update-checkstyle branch from b0cdc26 to 8dfd1ff Compare April 30, 2024 05:55
@jjaakola-aiven jjaakola-aiven force-pushed the jjaakola-aiven-update-checkstyle branch from 8dfd1ff to 60b75b2 Compare April 30, 2024 05:56
Copy link
Contributor

@eliax1996 eliax1996 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@eliax1996 eliax1996 merged commit 39babfb into master Apr 30, 2024
3 checks passed
@eliax1996 eliax1996 deleted the jjaakola-aiven-update-checkstyle branch April 30, 2024 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants