You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org> on 2024/01/12 02:35:57 UTC
Re: [PR] Propagate Intervals.of() error message to user (druid)
github-advanced-security[bot] commented on code in PR #15454:
URL: https://github.com/apache/druid/pull/15454#discussion_r1449724708
##########
server/src/test/java/org/apache/druid/server/http/DataSourcesResourceTest.java:
##########
@@ -611,19 +612,9 @@
EasyMock.replay(overlordClient, server);
DataSourcesResource dataSourcesResource =
new DataSourcesResource(inventoryView, null, null, overlordClient, null, null, auditManager);
- try {
- Response response =
- dataSourcesResource.markAsUnusedAllSegmentsOrKillUnusedSegmentsInInterval("datasource", "true", "???", request);
- // 400 (Bad Request) or an IllegalArgumentException is expected.
- Assert.assertEquals(400, response.getStatus());
- Assert.assertNotNull(response.getEntity());
- Assert.assertTrue(response.getEntity().toString().contains("java.lang.IllegalArgumentException"));
- }
- catch (IllegalArgumentException ignore) {
- // expected
- }
-
- EasyMock.verify(overlordClient, server);
+ DruidExceptionMatcher.invalidInput().assertThrowsAndMatches(
+ () -> dataSourcesResource.markAsUnusedAllSegmentsOrKillUnusedSegmentsInInterval("datasource", "true", "???", request)
Review Comment:
## Deprecated method or constructor invocation
Invoking [DataSourcesResource.markAsUnusedAllSegmentsOrKillUnusedSegmentsInInterval](1) should be avoided because it has been deprecated.
[Show more details](https://github.com/apache/druid/security/code-scanning/6444)
--
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: commits-unsubscribe@druid.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org