Skip to content

Commit 6259569

Browse files
Merge pull request #266 from data-integrations/refactor/db-connector-test
refactor db-connector-test
2 parents 0ef95e0 + 93b8fe2 commit 6259569

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

database-commons/src/test/java/io/cdap/plugin/db/connector/DBSpecificConnectorBaseTest.java

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -249,19 +249,13 @@ protected void testGenerateSpec(AbstractDBSpecificConnector connector, String pl
249249
}
250250
Set<PluginSpec> relatedPlugins = connectorSpec.getRelatedPlugins();
251251
Assert.assertEquals(2, relatedPlugins.size());
252-
Iterator<PluginSpec> relatedPluginsIterator = relatedPlugins.iterator();
253-
PluginSpec pluginSpec = relatedPluginsIterator.next();
252+
Iterator<PluginSpec> iterator = relatedPlugins.iterator();
253+
PluginSpec pluginSpec = iterator.next();
254254
Assert.assertEquals(pluginName, pluginSpec.getName());
255-
Assert.assertTrue(pluginSpec.getType().equals(BatchSource.PLUGIN_TYPE) ||
256-
pluginSpec.getType().equals(BatchSink.PLUGIN_TYPE));
257-
PluginSpec pluginSpec1 = relatedPluginsIterator.next();
258-
Assert.assertEquals(pluginName, pluginSpec1.getName());
259-
if (pluginSpec.getType().equals(BatchSink.PLUGIN_TYPE)) {
260-
Assert.assertEquals(BatchSource.PLUGIN_TYPE, pluginSpec1.getType());
261-
} else {
262-
Assert.assertEquals(BatchSink.PLUGIN_TYPE, pluginSpec1.getType());
263-
}
264-
255+
Assert.assertEquals(BatchSink.PLUGIN_TYPE, pluginSpec.getType());
256+
pluginSpec = iterator.next();
257+
Assert.assertEquals(pluginName, pluginSpec.getName());
258+
Assert.assertEquals(BatchSource.PLUGIN_TYPE, pluginSpec.getType());
265259
Map<String, String> properties = pluginSpec.getProperties();
266260
Assert.assertNull(properties.get(NAME_USE_CONNECTION));
267261
Assert.assertNull(properties.get(NAME_CONNECTION));

0 commit comments

Comments
 (0)