public class ExpectedExceptionWithCode extends ExpectedException
Modifier | Constructor and Description |
---|---|
|
ExpectedExceptionWithCode(ErrorCode code)
Constructs a new expected exception with
null as its
detail message. |
|
ExpectedExceptionWithCode(ErrorCode code,
Throwable cause)
Constructs a new expected exception with the specified detail message and
cause.
|
protected |
ExpectedExceptionWithCode(ErrorCode code,
Throwable cause,
boolean enableSuppression,
boolean writableStackTrace)
Constructs a new expected exception with the specified detail
message, cause, suppression enabled or disabled, and writable
stack trace enabled or disabled.
|
Modifier and Type | Method and Description |
---|---|
ErrorCode |
getCode() |
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
public ExpectedExceptionWithCode(ErrorCode code)
null
as its
detail message. The cause is not initialized, and may subsequently be
initialized by a call to Throwable.initCause(java.lang.Throwable)
.code
- the detail error code and message (which is saved for later retrieval
by the getCode()
and Throwable.getMessage()
method).public ExpectedExceptionWithCode(ErrorCode code, Throwable cause)
Note that the detail message associated with
cause
is not automatically incorporated in
this expected exception's detail message.
code
- the detail error code and message (which is saved for later retrieval
by the getCode()
and Throwable.getMessage()
method).cause
- the cause (which is saved for later retrieval by the
Throwable.getCause()
method). (A null value is
permitted, and indicates that the cause is nonexistent or
unknown.)protected ExpectedExceptionWithCode(ErrorCode code, Throwable cause, boolean enableSuppression, boolean writableStackTrace)
code
- the detail error code and message (which is saved for later retrieval
by the getCode()
and Throwable.getMessage()
method).cause
- the cause. (A null
value is permitted,
and indicates that the cause is nonexistent or unknown.)enableSuppression
- whether or not suppression is enabled
or disabledwritableStackTrace
- whether or not the stack trace should
be writablepublic ErrorCode getCode()
Copyright © 2018. All rights reserved.