提交 4b23b0f2 编写于 作者: W wizardforcel

2020-06-08 20:52:03

上级 02f5187a
......@@ -2,7 +2,7 @@
> 原文: [https://howtodoinjava.com/junit/how-to-write-parameterized-testcases-with-junit-4/](https://howtodoinjava.com/junit/how-to-write-parameterized-testcases-with-junit-4/)
在本 [JUnit 教程](https://howtodoinjava.com/junit-5-tutorial/)中,学习创建和执行 junit 参数化测试。 参数化测试是正常测试,它使用不同的测试参数反复执行。 它可以帮助开发人员节省使用不同输入类型执行相同测试以测试功能健壮性以及可能的功能边界的时间。
在本 [JUnit 教程](https://howtodoinjava.com/junit-5-tutorial/)中,学习创建和执行 junit 参数化测试。 参数化测试是正常测试,它使用不同的测试参数反复执行。 它可以帮助开发人员在使用不同输入类型执行相同测试以测试函数健壮性,以及可能的函数边界上面节省时间。
## 1\. JUnit Maven 依赖项
......
......@@ -2,7 +2,7 @@
> 原文: [https://howtodoinjava.com/resteasy/resteasy-bean-validation-using-hibernate-validator-provider/](https://howtodoinjava.com/resteasy/resteasy-bean-validation-using-hibernate-validator-provider/)
Bean 验证 API([**JSR-303**](https://jcp.org/en/jsr/detail?id=303 "jsr-303"))基于注解定义了用于 bean 验证的元数据模型和 API。 该功能是通过 resteasy-hibernatevalidator-provider 组件实现的。 为了集成,我们需要将`resteasy-hibernatevalidator-provider.jar``hibernate-validator.jar`文件添加到类路径。
Bean 验证 API([**JSR-303**](https://jcp.org/en/jsr/detail?id=303 "jsr-303"))基于注解定义了用于 bean 验证的元数据模型和 API。 该功能是通过`resteasy-hibernatevalidator-provider`组件实现的。 为了集成,我们需要将`resteasy-hibernatevalidator-provider.jar``hibernate-validator.jar`文件添加到类路径。
如果您使用的是 maven,则只需添加以下依赖项。 随身更改 RESTEasy 的版本号。
......@@ -55,7 +55,7 @@ public class UserService
## 步骤 2)添加验证异常处理器
好吧,这很重要,因为 **Hiberate 验证器插件没有任何用于异常处理的功能,因此您需要嵌入**。 RESTEasy 中的异常处理器通过`ExceptionMapper`类使用。
好吧,这很重要,因为 **Hiberate 验证器插件没有任何用于异常处理的功能,因此您需要嵌入自己的**。 RESTEasy 中的异常处理器通过`ExceptionMapper`类使用。
```java
package com.howtodoinjava.exception;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册