FrankChen021 commented on code in PR #19876:
URL: https://github.com/apache/druid/pull/19876#discussion_r3717599161
##########
extensions-core/lookups-cached-single/src/test/java/org/apache/druid/server/lookup/PollingLookupSerDeserTest.java:
##########
@@ -41,40 +40,40 @@
import java.util.Map;
-@RunWith(Parameterized.class)
public class PollingLookupSerDeserTest
{
- @Parameterized.Parameters
public static Collection<Object[]> inputData()
{
return Arrays.asList(new Object[][]{
{new OffHeapPollingCache.OffHeapPollingCacheProvider()}, {new
OnHeapPollingCache.OnHeapPollingCacheProvider<>()}
});
}
- private final PollingCacheFactory cacheFactory;
+ private PollingCacheFactory cacheFactory;
private final DataFetcher dataFetcher = new MockDataFetcher();
- public PollingLookupSerDeserTest(PollingCacheFactory cacheFactory)
+ public void initPollingLookupSerDeserTest(PollingCacheFactory cacheFactory)
{
this.cacheFactory = cacheFactory;
}
- @Test
- public void testSerDeser() throws IOException
+ @MethodSource("inputData")
+ @ParameterizedTest
+ public void testSerDeser(PollingCacheFactory cacheFactory) throws IOException
{
+ initPollingLookupSerDeserTest(cacheFactory);
ObjectMapper mapper = new DefaultObjectMapper();
PollingLookupFactory pollingLookupFactory = new
PollingLookupFactory(Period.ZERO, dataFetcher, cacheFactory);
mapper.registerSubtypes(MockDataFetcher.class);
mapper.registerSubtypes(PollingLookupFactory.class);
- Assert.assertEquals(pollingLookupFactory,
mapper.readerFor(LookupExtractorFactory.class).readValue(mapper.writeValueAsString(pollingLookupFactory)));
+ Assertions.assertEquals(pollingLookupFactory,
mapper.readerFor(LookupExtractorFactory.class).readValue(mapper.writeValueAsString(pollingLookupFactory)));
}
@JsonTypeName("mock")
private static class MockDataFetcher implements DataFetcher
{
@JsonCreator
- public MockDataFetcher()
+ public void initPollingLookupSerDeserTest()
{
}
Review Comment:
Actionable. The JUnit migration had converted the original no-argument
MockDataFetcher constructor into an instance void method while retaining
@JsonCreator. I restored it as public MockDataFetcher(), so @JsonCreator now
targets a valid constructor and the intended Jackson subtype behavior is
preserved. PollingLookupSerDeserTest passed both parameterized cases (2 tests,
0 failures); Checkstyle and SpotBugs also passed.
##########
extensions-core/parquet-extensions/pom.xml:
##########
@@ -127,10 +127,25 @@
<groupId>com.github.rvesse</groupId>
<artifactId>airline</artifactId>
<scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
Review Comment:
Fixed in commit 4676b86270 by normalizing the newly added JUnit dependency
block to the surrounding two-space POM indentation. Checkstyle passed with 0
violations, and the module-scoped SpotBugs check passed with 0 bugs/errors.
##########
extensions-core/hdfs-storage/pom.xml:
##########
@@ -106,9 +106,24 @@
</dependency>
<!-- Tests -->
+ <dependency>
+ <groupId>org.junit.jupiter</groupId>
+ <artifactId>junit-jupiter</artifactId>
+ <scope>test</scope>
+ </dependency>
Review Comment:
Fixed in commit 4676b86270 by normalizing the newly added JUnit dependency
block to the surrounding four-space POM indentation. Checkstyle passed with 0
violations, and the module-scoped SpotBugs check passed with 0 bugs/errors.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]