amaliujia commented on code in PR #1596:
URL: https://github.com/apache/ratis/pull/1596#discussion_r4067865028
##########
ratis-common/src/test/java/org/apache/ratis/util/TestIOUtils.java:
##########
@@ -50,19 +68,91 @@ public void testReadObjectAllowsStackTraceElements() {
}
@Test
- public void testReadObjectRejectsDisallowedClass() throws IOException {
+ public void testAllowedList() throws Exception {
+ // BigDecimal is in java.math which is in neither the allow-list nor the
disallow-list
+ final BigDecimal pi = new BigDecimal("3.14");
+ assertDisallowed(pi, false);
+
+ // Hide it inside a list
+ final List<Object> list = new ArrayList<>();
+ list.add("testing");
+ list.add(pi);
+ assertDisallowed(list, false);
Review Comment:
just a readability suggestion:
rename `assertDisallowed(list, false)` to `assertAllowed(list)` and handle
the true/false inside.
--
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]