liubao68 commented on a change in pull request #2600:
URL:
https://github.com/apache/servicecomb-java-chassis/pull/2600#discussion_r737113258
##########
File path:
demo/demo-jaxrs/jaxrs-client/src/main/java/org/apache/servicecomb/demo/jaxrs/client/validation/ValidationServiceClient.java
##########
@@ -81,5 +82,15 @@ private static void testValidation() {
TestMgr.check(Status.BAD_REQUEST, e.getReasonPhrase());
TestMgr.check(e.getErrorData().toString().contains("Parameter is not
valid for operation"), true);
}
+
+ try {
+ Teacher teacher = new Teacher();
+ teacher.setAge("20");
+ template.postForObject(urlPrefix + "/sayTeacherInfo", teacher,
Teacher.class);
Review comment:
```
Teacher teacher = new Teacher();
teacher.setName("teacher");
teacher.setAge("20");
Teacher response = template.postForObject(urlPrefix +
"/sayTeacherInfo", teacher, Teacher.class);
TestMgr.check(response.getName(), "teacher");
try {
Teacher teacher = new Teacher();
teacher.setName("teacher");
teacher.setAge("20");
template.postForObject(urlPrefix + "/sayTeacherInfo", teacher,
Teacher.class);
TestMgr.fail("should throw exception");
} catch (InvocationException e) {
TestMgr.check(400, e.getStatus().getStatusCode());
TestMgr.check(e.getErrorData().toString().contains("不能为空"), true);
}
``
I mean add
`TestMgr.fail("should throw exception");`
--
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]