Skip to content

Commit

Permalink
Merge pull request #266 from data-integrations/refactor/db-connector-…
Browse files Browse the repository at this point in the history
…test

refactor db-connector-test
  • Loading branch information
itsankit-google authored May 13, 2022
2 parents 0ef95e0 + 93b8fe2 commit 6259569
Showing 1 changed file with 6 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -249,19 +249,13 @@ protected void testGenerateSpec(AbstractDBSpecificConnector connector, String pl
}
Set<PluginSpec> relatedPlugins = connectorSpec.getRelatedPlugins();
Assert.assertEquals(2, relatedPlugins.size());
Iterator<PluginSpec> relatedPluginsIterator = relatedPlugins.iterator();
PluginSpec pluginSpec = relatedPluginsIterator.next();
Iterator<PluginSpec> iterator = relatedPlugins.iterator();
PluginSpec pluginSpec = iterator.next();
Assert.assertEquals(pluginName, pluginSpec.getName());
Assert.assertTrue(pluginSpec.getType().equals(BatchSource.PLUGIN_TYPE) ||
pluginSpec.getType().equals(BatchSink.PLUGIN_TYPE));
PluginSpec pluginSpec1 = relatedPluginsIterator.next();
Assert.assertEquals(pluginName, pluginSpec1.getName());
if (pluginSpec.getType().equals(BatchSink.PLUGIN_TYPE)) {
Assert.assertEquals(BatchSource.PLUGIN_TYPE, pluginSpec1.getType());
} else {
Assert.assertEquals(BatchSink.PLUGIN_TYPE, pluginSpec1.getType());
}

Assert.assertEquals(BatchSink.PLUGIN_TYPE, pluginSpec.getType());
pluginSpec = iterator.next();
Assert.assertEquals(pluginName, pluginSpec.getName());
Assert.assertEquals(BatchSource.PLUGIN_TYPE, pluginSpec.getType());
Map<String, String> properties = pluginSpec.getProperties();
Assert.assertNull(properties.get(NAME_USE_CONNECTION));
Assert.assertNull(properties.get(NAME_CONNECTION));
Expand Down

0 comments on commit 6259569

Please sign in to comment.