public final class ResultBuilder extends Object
Modifier and Type | Field and Description |
---|---|
private Controller |
controller
Controller for test.
|
private Boolean |
isSuccessful
Is the test successful?
|
private ArrayList<Returns> |
returnedStatusList
List of statuses.
|
private String |
testLog
Log for test.
|
private Result |
testResult
Tracks result of test, including whether result has been reported.
|
Modifier | Constructor and Description |
---|---|
private |
ResultBuilder(Controller controllerParam)
Constructs builder.
|
Modifier and Type | Method and Description |
---|---|
ResultBuilder |
addLog(String logParam)
Add entry to test log.
|
ResultBuilder |
addState(Returns resultParam)
Adds a result enumeration tag.
|
ResultBuilder |
addState(Returns resultState,
String stateReasonParam)
Adds a state and updates the test log with why the state was added.
|
Result |
getTestResult()
Returns result of test.
|
static ResultBuilder |
newTestResultBuilder(Controller testParam)
Factory creates new ResultBuilder model.
|
ResultBuilder |
setIsSuccessful(boolean isSuccessfulParam)
Sets success flag.
|
private Boolean isSuccessful
private Controller controller
private String testLog
private ArrayList<Returns> returnedStatusList
private Result testResult
private ResultBuilder(Controller controllerParam)
controllerParam
- test controller for test being documented.public ResultBuilder setIsSuccessful(boolean isSuccessfulParam)
isSuccessfulParam
- set this to true if successfulpublic ResultBuilder addLog(String logParam)
logParam
- message to add to this test's logIllegalStateException
- of result has already been provided.NullPointerException
- if null value is passed in place of message.public ResultBuilder addState(Returns resultState, String stateReasonParam)
resultState
- what state is happeningstateReasonParam
- why is this state occurring?public ResultBuilder addState(Returns resultParam)
resultParam
- result of test.public static ResultBuilder newTestResultBuilder(Controller testParam)
testParam
- controller for test for which result is being created.public Result getTestResult()
IllegalStateException
- if result was already provided, or if
test success state or test log are missing.Copyright © 2018. All rights reserved.