Copilot commented on code in PR #19876:
URL: https://github.com/apache/druid/pull/19876#discussion_r3717412916
##########
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:
`@JsonCreator` is applied to an instance void method, which Jackson will not
treat as a creator (creator must be a constructor or a static factory returning
the type). This will break compilation/serde for `MockDataFetcher` subtype
registration.
##########
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:
The newly added JUnit dependency block has inconsistent indentation compared
to surrounding dependencies in this POM.
##########
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:
The newly added JUnit dependency block has inconsistent indentation compared
to the rest of the POM, making the diff noisy and harder to read.
--
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]