unknowntpo commented on code in PR #6847:
URL: https://github.com/apache/gravitino/pull/6847#discussion_r2072570130
##########
clients/cli/src/test/java/org/apache/gravitino/cli/output/TestTableFormat.java:
##########
@@ -665,4 +740,13 @@ private org.apache.gravitino.rel.Column getMockColumn(
return mockColumn;
}
+
+ private Tag getMockTag(String name, String comment) {
+ Tag mockTag = mock(Tag.class);
+ when(mockTag.name()).thenReturn(name);
+ when(mockTag.comment()).thenReturn(comment);
+ when(mockTag.properties()).thenReturn(ImmutableMap.of("k1", "v1", "k2",
"v2"));
Review Comment:
I think this will not be null, because if properties is null, then in
`TableFormat.output` and `PlainFormat.output`, we cannot determine `null`
entity is from which type.
So I liberate on this, and make properties a empty map if it's is null.
```
// ListTagProperties.java
/** List the properties of a tag. */
@Override
public void handle() {
Tag gTag = null;
// some logic about getting gTag
...
if (gTag != null) {
Map<String, String> props =
gTag.properties() != null ? gTag.properties() :
Collections.emptyMap();
printProperties(props);
}
}
```
--
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]