![JAR search and dependency download from the Maven repository](/logo.png)
FitNesseRoot.RestFixtureTests.IssueFixes.Issue174.content.txt Maven / Gradle / Ivy
!3 [[Issue #174][https://github.com/smartrics/RestFixture/issues/174]] Using multiple fixtures together
The issue reports that symbols can't be shared across fixtures when .RestFixture is used.
This fixture is a decision table simply used to define four different values in the slim shared map of symbols.
The fixture class allows setting a value and then getting it back:
{{{
public class DecisionFixtureTest {
private String value;
public void setValue(String value) {
this.value = value;
}
public String value() {
return value;
}
}
}}}
In this case we define two symbols for URIs (one success and one fail) and two symbols for return code.
!| decision fixture test |
| value | value? |
| /resources/0 | $foundResourceUri= |
| 200 | $successCode= |
| /resources/99 | $notFoundResourceUri= |
| 404 | $notFoundCode= |
Symbols defined in the above table are then used in rest fixture. This demonstrates that .RestFixture accepts symbols and can resolve them.
| Table: Rest Fixture |http://${jettyHost}:${jettyPort}| |
|GET | $foundResourceUri | $successCode | | |
|let | ok_status_code | js | response.statusCode | |
|GET | $notFoundResourceUri | $notFoundCode | | |
|let | not_found_status_code | js | response.statusCode | |
The fixture above then defines - via "let" command - two more symbols: "ok_status_code" and "not_found_status_code". The two symbols are re-used in a new instaance of the decision fixture test below
!| decision fixture test |
| value | value? |
| $ok_status_code | 200 |
| $not_found_status_code | 404 |
© 2015 - 2025 Weber Informatics LLC | Privacy Policy