FrankChen021 commented on code in PR #19881:
URL: https://github.com/apache/druid/pull/19881#discussion_r3715084502
##########
extensions-core/datasketches/src/test/java/org/apache/druid/query/aggregation/datasketches/tuple/ArrayOfDoublesSketchSetOpPostAggregatorTest.java:
##########
@@ -38,32 +38,31 @@
import org.apache.druid.segment.column.ColumnType;
import org.apache.druid.segment.column.RowSignature;
import org.easymock.EasyMock;
-import org.junit.Assert;
-import org.junit.Rule;
-import org.junit.Test;
-import org.junit.rules.ExpectedException;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
import java.util.Arrays;
import java.util.Comparator;
import java.util.Map;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
public class ArrayOfDoublesSketchSetOpPostAggregatorTest
{
- @Rule
- public ExpectedException expectedException = ExpectedException.none();
@Test
public void testConstructorNumArgs()
{
- expectedException.expect(IAE.class);
- expectedException.expectMessage("Illegal number of fields[0], must be >
1");
- final PostAggregator there = new ArrayOfDoublesSketchSetOpPostAggregator(
- "a",
- "UNION",
- null,
- null,
- ImmutableList.of()
- );
+ Throwable exception = Assertions.assertThrows(IAE.class, () -> {
+ final PostAggregator there = new ArrayOfDoublesSketchSetOpPostAggregator(
+ "a",
+ "UNION",
+ null,
+ null,
+ ImmutableList.of()
+ );
Review Comment:
Fixed in 582433c5d4. The migrated assertThrows lambda no longer assigns the
intentionally-throwing constructor to an unread local. The focused test passes
all 6 tests, and Datasketches Checkstyle passes.
--
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]