mchades commented on code in PR #3879:
URL: https://github.com/apache/gravitino/pull/3879#discussion_r1663912433
##########
server/src/test/java/com/datastrato/gravitino/server/web/rest/TestMetalakeOperations.java:
##########
@@ -178,6 +183,19 @@ public void testCreateMetalake() {
Assertions.assertEquals(ErrorConstants.ILLEGAL_ARGUMENTS_CODE,
errorResponse.getCode());
Assertions.assertEquals(
IllegalArgumentException.class.getSimpleName(),
errorResponse.getType());
+
+ String req2 =
"{\"names\":\"metalake\",\"comment\":\"comment\",\"properties\":{}}";
Review Comment:
Thanks for your detailed feedback!
If so, it's recommended to register a new test path dedicated to testing the
`JsonProcessingException`:
for example:
```
public class TestMetalakeOperations extends JerseyTest {
// ....
@Override
protected Application configure() {
// ......
resourceConfig.register(MetalakeOperations.class);
resourceConfig.register(TestException.class);
// ......
}
@Path("/test")
public static class TestException {
@GET
public Response getResponse() throws JsonProcessingException {
throw new JsonProcessingException("Error processing JSON") {};
}
}
// then test exception by /test
}
```
--
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]