|
1 |
| package com.agical.rmock.core.strategy.impl; |
|
2 |
| |
|
3 |
| import com.agical.rmock.core.exception.manager.ExceptionVerifier; |
|
4 |
| import com.agical.rmock.core.strategy.TestStep; |
|
5 |
| |
|
6 |
| |
|
7 |
| |
|
8 |
| |
|
9 |
| |
|
10 |
| |
|
11 |
| public class ExceptionVerifierTestStepDecorator implements TestStep { |
|
12 |
| |
|
13 |
| private ExceptionVerifier exceptionVerifier; |
|
14 |
| private final TestStep testStep; |
|
15 |
| |
|
16 |
1088
| public ExceptionVerifierTestStepDecorator(TestStep testStep) {
|
|
17 |
1088
| this.testStep = testStep;
|
|
18 |
| } |
|
19 |
| |
|
20 |
1066
| public void run() throws Throwable {
|
|
21 |
1066
| try {
|
|
22 |
1066
| testStep.run();
|
|
23 |
| } catch (Throwable e) { |
|
24 |
23
| exceptionVerifier.verifyActualThrowable( e );
|
|
25 |
| } |
|
26 |
| } |
|
27 |
| |
|
28 |
2170
| public void setExceptionVerifier(ExceptionVerifier exceptionVerifier) {
|
|
29 |
2170
| this.exceptionVerifier = exceptionVerifier;
|
|
30 |
| } |
|
31 |
| |
|
32 |
| } |