OfficeScenarioTests CoopShares+Assets #121
@ -51,6 +51,7 @@ public abstract class UseCase<T extends UseCase<?>> {
|
|||||||
private final Map<String, Object> givenProperties = new LinkedHashMap<>();
|
private final Map<String, Object> givenProperties = new LinkedHashMap<>();
|
||||||
|
|
||||||
private String nextTitle; // just temporary to override resultAlias for sub-use-cases
|
private String nextTitle; // just temporary to override resultAlias for sub-use-cases
|
||||||
|
private String introduction;
|
||||||
|
|
||||||
public UseCase(final ScenarioTest testSuite) {
|
public UseCase(final ScenarioTest testSuite) {
|
||||||
this(testSuite, getResultAliasFromProducesAnnotationInCallStack());
|
this(testSuite, getResultAliasFromProducesAnnotationInCallStack());
|
||||||
@ -72,6 +73,9 @@ public abstract class UseCase<T extends UseCase<?>> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final HttpResponse doRun() {
|
public final HttpResponse doRun() {
|
||||||
|
if (introduction != null) {
|
||||||
|
testReport.printPara(introduction);
|
||||||
|
}
|
||||||
testReport.printPara("### Given Properties");
|
testReport.printPara("### Given Properties");
|
||||||
testReport.printLine("""
|
testReport.printLine("""
|
||||||
| name | value |
|
| name | value |
|
||||||
@ -96,6 +100,11 @@ public abstract class UseCase<T extends UseCase<?>> {
|
|||||||
protected void verify(final HttpResponse response) {
|
protected void verify(final HttpResponse response) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public UseCase<T> introduction(final String introduction) {
|
||||||
|
this.introduction = introduction;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
public final UseCase<T> given(final String propName, final Object propValue) {
|
public final UseCase<T> given(final String propName, final Object propValue) {
|
||||||
givenProperties.put(propName, propValue);
|
givenProperties.put(propName, propValue);
|
||||||
ScenarioTest.putProperty(propName, propValue);
|
ScenarioTest.putProperty(propName, propValue);
|
||||||
|
@ -17,7 +17,7 @@ public class CreatePartner extends UseCase<CreatePartner> {
|
|||||||
public CreatePartner(final ScenarioTest testSuite) {
|
public CreatePartner(final ScenarioTest testSuite) {
|
||||||
super(testSuite);
|
super(testSuite);
|
||||||
|
|
||||||
// FIXME: Anmerkung, dass alle Partner Kunden sind
|
introduction("A partner can be a client or a vendor, currently we only use them for clients.");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user