divijvaidya commented on code in PR #12473:
URL: https://github.com/apache/kafka/pull/12473#discussion_r952630756
##########
connect/runtime/src/test/java/org/apache/kafka/connect/runtime/AbstractHerderTest.java:
##########
@@ -556,28 +473,24 @@ public void testConfigValidationTransformsExtendResults()
{
assertEquals("transforms.xformB.type",
infos.get("transforms.xformB.type").configValue().name());
assertFalse(infos.get("transforms.xformB.type").configValue().errors().isEmpty());
- verifyAll();
+ verify(plugins, times(2)).transformations();
+ verify(plugins).newConnector(connectorClass.getName());
+ verify(plugins).compareAndSwapLoaders(insConnector);
}
- @Test()
+ @Test
public void testConfigValidationPredicatesExtendResults() {
- AbstractHerder herder =
createConfigValidationHerder(SampleSourceConnector.class,
noneConnectorClientConfigOverridePolicy);
+ final Class<? extends Connector> connectorClass =
SampleSourceConnector.class;
+ AbstractHerder herder = createConfigValidationHerder(connectorClass,
noneConnectorClientConfigOverridePolicy);
// 2 transform aliases defined -> 2 plugin lookups
- Set<PluginDesc<Transformation<?>>> transformations = new HashSet<>();
- transformations.add(transformationPluginDesc());
-
EasyMock.expect(plugins.transformations()).andReturn(transformations).times(1);
-
- Set<PluginDesc<Predicate<?>>> predicates = new HashSet<>();
- predicates.add(predicatePluginDesc());
- EasyMock.expect(plugins.predicates()).andReturn(predicates).times(2);
-
- replayAll();
+
when(plugins.transformations()).thenReturn(Collections.singleton(transformationPluginDesc()));
+
when(plugins.predicates()).thenReturn(Collections.singleton(predicatePluginDesc()));
// Define 2 transformations. One has a class defined and so can get
embedded configs, the other is missing
Review Comment:
Yep, looks like it. `predX` and `predY`
Changed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]