github-advanced-security[bot] commented on code in PR #16092:
URL: https://github.com/apache/druid/pull/16092#discussion_r1518799086
##########
services/src/test/java/org/apache/druid/server/AsyncQueryForwardingServletTest.java:
##########
@@ -402,30 +354,13 @@
public void testHandleQueryParseExceptionWithFilterDisabled() throws
Exception
{
String errorMessage = "test exception message";
- ObjectMapper mockMapper = Mockito.mock(ObjectMapper.class);
- HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
- HttpServletResponse response = Mockito.mock(HttpServletResponse.class);
- ServletOutputStream outputStream = Mockito.mock(ServletOutputStream.class);
- Mockito.when(response.getOutputStream()).thenReturn(outputStream);
- final AsyncQueryForwardingServlet servlet = new
AsyncQueryForwardingServlet(
- new MapQueryToolChestWarehouse(ImmutableMap.of()),
- mockMapper,
- TestHelper.makeSmileMapper(),
- null,
- null,
- null,
- new NoopServiceEmitter(),
- new NoopRequestLogger(),
- new DefaultGenericQueryMetricsFactory(),
- new AuthenticatorMapper(ImmutableMap.of()),
- new Properties(),
- new ServerConfig()
+ boolean haveRequest = true;
Review Comment:
## Unread local variable
Variable 'boolean haveRequest' is never read.
[Show more
details](https://github.com/apache/druid/security/code-scanning/6991)
##########
services/src/test/java/org/apache/druid/server/AsyncQueryForwardingServletTest.java:
##########
@@ -436,43 +371,25 @@
public void testHandleQueryParseExceptionWithFilterEnabled() throws Exception
{
String errorMessage = "test exception message";
- ObjectMapper mockMapper = Mockito.mock(ObjectMapper.class);
- HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
- HttpServletResponse response = Mockito.mock(HttpServletResponse.class);
- ServletOutputStream outputStream = Mockito.mock(ServletOutputStream.class);
- Mockito.when(response.getOutputStream()).thenReturn(outputStream);
- final AsyncQueryForwardingServlet servlet = new
AsyncQueryForwardingServlet(
- new MapQueryToolChestWarehouse(ImmutableMap.of()),
- mockMapper,
- TestHelper.makeSmileMapper(),
- null,
- null,
- null,
- new NoopServiceEmitter(),
- new NoopRequestLogger(),
- new DefaultGenericQueryMetricsFactory(),
- new AuthenticatorMapper(ImmutableMap.of()),
- new Properties(),
- new ServerConfig()
- {
- @Override
- public boolean isShowDetailedJettyErrors()
- {
- return true;
- }
+ boolean haveRequest = true;
Review Comment:
## Unread local variable
Variable 'boolean haveRequest' is never read.
[Show more
details](https://github.com/apache/druid/security/code-scanning/6992)
##########
services/src/test/java/org/apache/druid/server/AsyncQueryForwardingServletTest.java:
##########
@@ -484,43 +401,26 @@
public void
testHandleQueryParseExceptionWithFilterEnabledButMessageMatchAllowedRegex()
throws Exception
{
String errorMessage = "test exception message";
- ObjectMapper mockMapper = Mockito.mock(ObjectMapper.class);
- HttpServletRequest request = Mockito.mock(HttpServletRequest.class);
- HttpServletResponse response = Mockito.mock(HttpServletResponse.class);
- ServletOutputStream outputStream = Mockito.mock(ServletOutputStream.class);
- Mockito.when(response.getOutputStream()).thenReturn(outputStream);
- final AsyncQueryForwardingServlet servlet = new
AsyncQueryForwardingServlet(
- new MapQueryToolChestWarehouse(ImmutableMap.of()),
- mockMapper,
- TestHelper.makeSmileMapper(),
- null,
- null,
- null,
- new NoopServiceEmitter(),
- new NoopRequestLogger(),
- new DefaultGenericQueryMetricsFactory(),
- new AuthenticatorMapper(ImmutableMap.of()),
- new Properties(),
- new ServerConfig()
- {
- @Override
- public boolean isShowDetailedJettyErrors()
- {
- return true;
- }
+ boolean haveRequest = true;
Review Comment:
## Unread local variable
Variable 'boolean haveRequest' is never read.
[Show more
details](https://github.com/apache/druid/security/code-scanning/6993)
--
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]