test(domain): Workflow Client, ACL client, store and job processor (refs #6)
Failing infrastructure unit tests (stub HttpMessageHandler, fakes): - FlowableWorkflowClient starts a process with the registrationId variable and returns the instance id; acquires OpenZaakAanmaken jobs (topic/workerId/lock) and parses their registrationId; completes a job with the zaakUrl variable — request URIs match flowable-rest's service/ and external-job-api/ paths. - AclHttpClient POSTs the bsn to the ACL and returns the zaak URL. - InMemoryRegistrationStore saves/reads/upserts by id. - OpenZaakJobProcessor acquires, opens a zaak, completes the job; leaves a failing job uncompleted for redelivery; polls harmlessly when idle. Adapters are stubs so the tests compile and fail on their assertions; the green commit implements them against the REST contract verified on a live Flowable. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ public class SubmitRegistrationTests
|
||||
[Fact]
|
||||
public async Task Submitting_persists_an_ingediend_registration_and_starts_the_process()
|
||||
{
|
||||
var store = new InMemoryRegistrationStore();
|
||||
var store = new FakeRegistrationStore();
|
||||
var workflow = new FakeWorkflowClient(processInstanceId: "proc-42");
|
||||
var handler = new SubmitRegistration(store, workflow);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class SubmitRegistrationTests
|
||||
{
|
||||
// The worker correlates the OpenZaakAanmaken job back to the aggregate by id, so the
|
||||
// aggregate must already be persisted when the process starts (ADR-0009).
|
||||
var store = new InMemoryRegistrationStore();
|
||||
var store = new FakeRegistrationStore();
|
||||
Registration? visibleAtStart = null;
|
||||
var workflow = new FakeWorkflowClient(onStart: id => visibleAtStart = store.GetAsync(id).Result);
|
||||
var handler = new SubmitRegistration(store, workflow);
|
||||
@@ -41,7 +41,7 @@ public class SubmitRegistrationTests
|
||||
[Fact]
|
||||
public async Task Submitting_without_a_bsn_is_rejected_and_starts_no_process()
|
||||
{
|
||||
var store = new InMemoryRegistrationStore();
|
||||
var store = new FakeRegistrationStore();
|
||||
var workflow = new FakeWorkflowClient();
|
||||
var handler = new SubmitRegistration(store, workflow);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user