我正在尝试定义自己的自定义异常.基本上我想防止用户在年龄小于16时被创建.接下来我已经提出了一些讨论/问题.
public enum Code {
USER_INVALID_AGE("The user age is invalid");
private String message;
Code(String message) {
this.message = message;
}
public String getMessage() {
return message;
}
}
Run Code Online (Sandbox Code Playgroud)
例外类:
public class TrainingException extends RuntimeException {
private Code code;
public TrainingException(Code code) {
this.code = code;
}
public Code getCode() {
return code;
}
public void setCode(Code code) {
this.code = code;
}
}
Run Code Online (Sandbox Code Playgroud)
在Validator包中,我有以下内容:
public class UserValidator implements Validator<User> {
/** {@inheritDoc} */
@Override
public void validate(User type) {
if …Run Code Online (Sandbox Code Playgroud) 我想问一下Cucumber和JUnit之间的实际区别是什么。我根本没有和Cucumber一起工作过;找到了一些文档,但是我非常感谢与这两者一起工作的人员提供的一些反馈(对lvl概述有兴趣)。
分解一下-我感兴趣的(我将使用Selenium而不是Protractor):
我需要完成的一些事情
除此以外的任何其他东西都值得欢迎。非常感谢您对此的回答,谢谢!