Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ public WorkflowInstance instance(Object input) {
return new WorkflowMutableInstance(this, application().idFactory().get(), inputModel);
}

public WorkflowInstance instance() {
return instance(null);
}

Optional<SchemaValidator> inputSchemaValidator() {
return inputSchemaValidator;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public void testOpenAPIBearerQueryInlinedBodyWithPositiveResponse() throws Excep
.setResponseCode(201));

Map<String, Object> result =
app.workflowDefinition(workflow).instance(Map.of()).start().get().asMap().orElseThrow();
app.workflowDefinition(workflow).instance().start().get().asMap().orElseThrow();

RecordedRequest restRequest = restServer.takeRequest();
assertEquals("POST", restRequest.getMethod());
Expand Down Expand Up @@ -194,13 +194,7 @@ public void testOpenAPIBearerQueryInlinedBodyWithNegativeResponse() throws Excep
Exception exception =
assertThrows(
Exception.class,
() ->
app.workflowDefinition(workflow)
.instance(Map.of())
.start()
.get()
.asMap()
.orElseThrow());
() -> app.workflowDefinition(workflow).instance().start().get().asMap().orElseThrow());
assertInstanceOf(WorkflowException.class, exception.getCause());
assertTrue(exception.getMessage().contains("status=409"));

Expand Down Expand Up @@ -244,11 +238,11 @@ public void testOpenAPIGetWithPositiveResponse() throws Exception {
.setResponseCode(200));

WorkflowDefinition definition = app.workflowDefinition(workflow);
assertData(definition.instance(Map.of()).start().get().asMap().orElseThrow());
assertData(definition.instance().start().get().asMap().orElseThrow());
RecordedRequest openAPIRequest = openApiServer.takeRequest();
assertEquals("GET", openAPIRequest.getMethod());

assertData(definition.instance(Map.of()).start().get().asMap().orElseThrow());
assertData(definition.instance().start().get().asMap().orElseThrow());
openAPIRequest = openApiServer.takeRequest();
assertEquals("HEAD", openAPIRequest.getMethod());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ public void setTest() throws Exception {
try (WorkflowApplication app = WorkflowApplication.builder().build()) {
app.workflowDefinition(workflowChild);
Map<String, Object> result =
app.workflowDefinition(workflowParent)
.instance(Map.of())
.start()
.join()
.asMap()
.orElseThrow();
app.workflowDefinition(workflowParent).instance().start().join().asMap().orElseThrow();
assertThat(result.get("counter"), is(equalTo(1)));
assertThat(result.get("greeting"), is(equalTo("helloWorld")));
}
Expand All @@ -62,12 +57,7 @@ public void setBlankInputTest() throws Exception {
try (WorkflowApplication app = WorkflowApplication.builder().build()) {
app.workflowDefinition(workflowChild);
Map<String, Object> result =
app.workflowDefinition(workflowParent)
.instance(Map.of())
.start()
.join()
.asMap()
.orElseThrow();
app.workflowDefinition(workflowParent).instance().start().join().asMap().orElseThrow();
assertThat(result.get("counter"), is(equalTo(1)));
assertThat(result.get("greeting"), is(equalTo("helloWorld")));
}
Expand Down Expand Up @@ -153,7 +143,7 @@ public void runSubWorkflowFromDslTest() throws Exception {
try (WorkflowApplication app = WorkflowApplication.builder().build()) {
app.workflowDefinition(child);
Map<String, Object> result =
app.workflowDefinition(parent).instance(Map.of()).start().join().asMap().orElseThrow();
app.workflowDefinition(parent).instance().start().join().asMap().orElseThrow();
assertThat(result.get("counter"), is(equalTo(1)));
assertThat(result.get("greeting"), is(equalTo("helloWorld")));
}
Expand Down Expand Up @@ -181,7 +171,7 @@ public void runSubWorkflowsFromDslTest() throws Exception {
app.workflowDefinition(child);
app.workflowDefinition(update);
Map<String, Object> result =
app.workflowDefinition(parent).instance(Map.of()).start().join().asMap().orElseThrow();
app.workflowDefinition(parent).instance().start().join().asMap().orElseThrow();
assertThat(result.get("counter"), is(equalTo(2)));
assertThat(result.get("greeting"), is(equalTo("helloWorld")));
}
Expand Down
Loading