github-advanced-security[bot] commented on code in PR #19548:
URL: https://github.com/apache/druid/pull/19548#discussion_r3402401068
##########
server/src/test/java/org/apache/druid/segment/join/LookupJoinableFactoryTest.java:
##########
@@ -138,6 +143,59 @@
Assert.assertFalse(factory.isDirectlyJoinable(new TableDataSource("foo")));
}
+ @Test
+ public void testBuildWithRetainedExtractorReleasesOnJoinableClose() throws
IOException
+ {
+ final AtomicInteger releaseCount = new AtomicInteger(0);
+ final MapLookupExtractor extractor = new
MapLookupExtractor(ImmutableMap.of("MX", "Mexico"), false);
+ final LookupJoinableFactory retainingFactory = new LookupJoinableFactory(
+ makeProvider(
+ new RetainingLookupExtractorFactory(
+ () -> extractor,
+ () -> Optional.of(RetainedLookupExtractor.create(extractor,
releaseCount::incrementAndGet))
+ )
+ )
+ );
+
+ final Joinable joinable = retainingFactory.build(lookupDataSource,
makeCondition("x == \"j.k\"")).get();
+ Assert.assertThat(joinable, CoreMatchers.instanceOf(LookupJoinable.class));
Review Comment:
## CodeQL / Deprecated method or constructor invocation
Invoking [Assert.assertThat](1) should be avoided because it has been
deprecated.
[Show more
details](https://github.com/apache/druid/security/code-scanning/11305)
--
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]