flyrain commented on code in PR #2486:
URL: https://github.com/apache/polaris/pull/2486#discussion_r2319855085
##########
polaris-core/src/test/java/org/apache/polaris/core/policy/PolicyTypeTest.java:
##########
@@ -53,4 +56,14 @@ public void testPredefinedPolicyTypeFromName(int code,
String name, boolean isIn
Assertions.assertThat(policyType.getName()).isEqualTo(name);
Assertions.assertThat(policyType.isInheritable()).isEqualTo(isInheritable);
}
+
+ @Test
+ void fromCodeReturnsNullForNegative() {
+ assertThat(PolicyType.fromCode(-1)).isNull();
+ }
+
+ @Test
+ void fromNameReturnsNullForUnknown() {
+ assertThat(PolicyType.fromName("__unknown__")).isNull();
+ }
Review Comment:
Not necessarily related, but good to have :)
--
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]