diff --git a/AGENTS.md b/AGENTS.md index e346753..b0119e4 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -17,7 +17,7 @@ Article: none A catalogue of runnable Mule 4 examples of design and integration patterns, one series per folder, each with MUnit tests and an accompanying article series. - **SOLID** (`solid/`, complete): before-and-after examples of the five SOLID principles. Each principle has a **before** endpoint that breaks the principle and an **after** endpoint that follows it, and MUnit tests show where the two behave the same and where the "before" version causes problems. -- **Enterprise Integration Patterns** (`eip/`, in progress): one folder and one MUnit suite per runnable pattern, using HTTP, object stores and the Scheduler only (and the Aggregators module for the aggregator), so the app runs with no external systems. Wave 1 (idempotent receiver, correlation identifier), wave 2 (content-based router, message filter, splitter, aggregator, recipient list, scatter-gather), wave 3 (message translator, canonical data model, content filter, claim check, content enricher) wave 4 (request-reply, return address, event-driven consumer, polling consumer, competing consumers, channel adapter) wave 5 (guaranteed delivery, transactional client, message expiration, invalid message channel) and wave 6 (process manager) are runnable; the patterns and their endpoints are listed in [README.md](README.md#enterprise-integration-patterns). Patterns that need a broker (publish-subscribe, dead letter channel, point-to-point channel) are documented with Anypoint MQ configuration in the wiki, not here; do not simulate a broker with VM queues. Object stores are in memory except the guaranteed delivery outbox and the process manager's process state and reply receipts, which are persistent by design; this app has no transactional connector, so the transactional client shows a compensation, not a rollback. +- **Enterprise Integration Patterns** (`eip/`, in progress): one folder and one MUnit suite per runnable pattern, using HTTP, object stores and the Scheduler only (and the Aggregators module for the aggregator, and the File connector on the local disk for the file transfer), so the app runs with no external systems. Wave 1 (idempotent receiver, correlation identifier), wave 2 (content-based router, message filter, splitter, aggregator, recipient list, scatter-gather), wave 3 (message translator, canonical data model, content filter, claim check, content enricher) wave 4 (request-reply, return address, event-driven consumer, polling consumer, competing consumers, channel adapter) wave 5 (guaranteed delivery, transactional client, message expiration, invalid message channel), wave 6 (process manager) and wave 7 (wire tap, file transfer) are runnable; the patterns and their endpoints are listed in [README.md](README.md#enterprise-integration-patterns). Patterns that need a broker (publish-subscribe, dead letter channel, point-to-point channel) are documented with Anypoint MQ configuration in the wiki, not here; do not simulate a broker with VM queues. Object stores are in memory except the guaranteed delivery outbox and the process manager's process state and reply receipts, which are persistent by design; this app has no transactional connector, so the transactional client shows a compensation, not a rollback. HTTP endpoint paths are referenced by published articles; do not change them when moving files. @@ -31,6 +31,7 @@ EIP examples use Bruno's MuleSoft naming rules (BRU-NAME-1 to BRU-NAME-3, `packs - `mule.http.connector.version = 1.11.3` — [pom.xml](pom.xml). - `mule.objectstore.connector.version = 1.3.2` — [pom.xml](pom.xml). - `mule.aggregators.module.version = 1.1.5` — [pom.xml](pom.xml). +- `mule.file.connector.version = 1.5.7` — [pom.xml](pom.xml). - `Declared minimum Mule runtime 4.9.0` — [mule-artifact.json](mule-artifact.json). These are source declarations, not evidence of installed runtimes. Maven properties may describe build/test dependencies rather than supported runtime minima; unresolved expressions remain inherited until verified. diff --git a/README.md b/README.md index d42bfef..5738d11 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,7 @@ curl -s 'localhost:8081/lsp/before/orders/ORD-1001?provider=new' mvn clean test ``` -MUnit runs on the Mule Enterprise runtime, so Maven needs access to the MuleSoft Enterprise repository (credentials in `~/.m2/settings.xml`, as in any MuleSoft project). The build fails below 80% application coverage; the current suites cover 198 cases at about 99.4%. +MUnit runs on the Mule Enterprise runtime, so Maven needs access to the MuleSoft Enterprise repository (credentials in `~/.m2/settings.xml`, as in any MuleSoft project). The build fails below 80% application coverage; the current suites cover 228 cases at about 99.4%. ## SOLID in MuleSoft @@ -55,7 +55,7 @@ Notes: ## Enterprise Integration Patterns -In progress. Patterns from Hohpe and Woolf's *Enterprise Integration Patterns*, implemented in Mule 4 around one scenario: an order is routed, charged and paid by a payment provider, its stock is reserved, and it is invoiced. Every runnable example uses HTTP, DataWeave and object stores only (plus the Aggregators module for the aggregator), so it needs no broker and no external system. +In progress. Patterns from Hohpe and Woolf's *Enterprise Integration Patterns*, implemented in Mule 4 around one scenario: an order is routed, charged and paid by a payment provider, its stock is reserved, and it is invoiced. Every runnable example uses HTTP, DataWeave and object stores only (plus the Aggregators module for the aggregator and the File connector, on the local disk, for the file transfer), so it needs no broker and no external system. **Wave 1, messaging and reliability:** @@ -114,6 +114,13 @@ In progress. Patterns from Hohpe and Woolf's *Enterprise Integration Patterns*, |---|---|---|---| | Process manager | A POST (the trigger message) starts a process for an order and answers 202 `RUNNING` with a `processId`. The manager sends each step to a simulated service on this app (payment, stock reservation, invoice, refund), which answers 202 and replies later, from an Async scope, to the manager's reply endpoint with the `processId` (the correlation identifier of wave 1 over the asynchronous request-reply of wave 4). The process state (`status`, `currentStep`, `history` of commands and replies) is kept in an object store declared `persistent="true"`, and the manager decides the next step from each reply: payment `DECLINED` (amount above `eip.processManager.paymentLimit`, 1000) ends `FAILED`; stock `UNAVAILABLE` (sku `SKU-OUT...`) sends a refund, the compensation, and ends `CANCELLED`; all ok ends `COMPLETED`. A refund `FAILED` ends `COMPENSATION_FAILED`. A reply is applied once per process and step (`os:store failIfPresent` on a receipts store whose entries expire after 7 days): a repeated reply for a step already applied, while the process runs, is 200 `DUPLICATE`; the same step with a different outcome is 409 `Conflicting reply`; a reply for a step the process is not waiting for is 409; a process not accepting replies (`FAILED`, `CANCELLED`, `COMPLETED`, `COMPENSATION_FAILED`, `SUSPENDED`) answers 409; an unknown `processId` 404, an unknown outcome 400. A command that cannot be sent leaves the process `SUSPENDED`: the start answers 503 with the `processId` in the body, the reply endpoint (whose reply was applied) 200 `APPLIED` with status `SUSPENDED`. The suspend re-reads the state and only suspends when nothing moved it on (compare-and-set); there is no other lock on the state, and that holds on one worker only. `SUSPENDED` and `COMPENSATION_FAILED` need recovery by hand or by a Scheduler; there is no resume endpoint. No timeout for a reply that never comes. Unlike a Routing Slip the sequence is not fixed up front. Overkill when every step answers synchronously: then one flow with a Choice per result and a Try for the refund is the orchestration | [`eip/process-manager/`](src/main/mule/eip/process-manager) | `POST /eip/process-manager/orders`, `POST /eip/process-manager/replies`, `GET /eip/process-manager/processes/{processId}`; simulated services: `POST /eip/process-manager/services/{payment\|stock\|invoice\|refund}` | +**Wave 7, wire tap and file transfer:** + +| Pattern | Scenario | Code | Endpoints | +|---|---|---|---| +| Wire tap | Every order is copied to a (simulated) audit system that can be slow or switched off. **Before:** the copy is written inline, so audit down fails the order (503; 504 on a timeout, after which the audit system may still record a copy of the order that was not accepted) and audit slow delays it. **After:** an Async scope with its own Try sends the payload as received; the order is accepted (201) whether the audit system is up, slow or down, and nothing the branch does to its payload or variables reaches the main flow. **The tap is lossy:** a refused copy, or one in memory when the app stops, is gone; after a timeout the outcome is unknown (the copy may still arrive, as it does here) and the tap does not retry; for a copy that must not be lost use guaranteed delivery. `maxConcurrency` is not set on the scope (see the header comment of `wire-tap.xml`) | [`eip/wire-tap/`](src/main/mule/eip/wire-tap) | `POST /eip/wire-tap/inline/orders`, `POST /eip/wire-tap/orders`, `PUT /eip/wire-tap/audit/availability`, `GET /eip/wire-tap/audit/copies` (and `POST /eip/wire-tap/audit/copies`, the simulated audit system) | +| File transfer (an integration style) | A producer writes a CSV file of orders under a temporary name and renames it; a File connector listener, matching only the final name and only regular files (no directories or symbolic links), reads it, records the rows and moves it to `processed`, or to `error` when any row is invalid. A failed run leaves the file in the inbox for the next poll. A name still waiting, or being written by another request, is refused (409); a name that arrives again is archived under a unique name, so nothing is overwritten. Directories are `eip.fileTransfer.*` in `app.yaml`: the inbox must exist at startup and defaults to the OS temporary directory, processed and error default to folders under it; on a shared temporary directory none of the three is private (with the sticky bit, as on Linux `/tmp`, another user's file or hard link with a matching name is imported, and a file the app cannot move is read again on every poll for as long as the app runs), so point them elsewhere outside a demo. Local disk only: on CloudHub it is ephemeral and private to a replica | [`eip/file-transfer/`](src/main/mule/eip/file-transfer) | `POST /eip/billing/exports`, `GET /eip/billing/imports`, `GET /eip/billing/rejected-files` | + The MUnit suites are in [`src/test/munit/eip/`](src/test/munit/eip), one per pattern. What the wave 1 suites show, observed on Mule 4.9.17 with MUnit 3.7.1: - With no `objectStore`, the idempotent validator keeps IDs in memory for 5 minutes (the defaults in the 4.9.17 runtime's `IdempotentMessageValidator`). Three different orders posted over HTTP from one For Each give `accepted,duplicate,duplicate`; with `idExpression="#[payload.orderId]"` they give `accepted,accepted,accepted`. @@ -158,6 +165,11 @@ What the wave 6 suite shows, observed on Mule 4.9.17 with MUnit 3.7.1 (calls go - Process manager: the happy path ends `COMPLETED` with the history `PAYMENT:SENT`, `PAYMENT:REPLY:APPROVED`, `STOCK:SENT`, `STOCK:REPLY:RESERVED`, `INVOICE:SENT`, `INVOICE:REPLY:ISSUED`; a payment of 5000 ends `FAILED` after the payment reply, with no stock or invoice step; a `SKU-OUT` order ends `CANCELLED` after `REFUND:REPLY:REFUNDED`, with no invoice. With the commands mocked (the services stay silent), the test sends the payment reply twice: 200 `APPLIED` then 200 `DUPLICATE`, applied once, and an invoice reply while the process waits for stock is 409. Two copies of the payment reply sent at once from a Scatter-Gather, each held just before the receipt claim until the other has read the state, get one `APPLIED` and one `DUPLICATE` (the second claim meets `OS:KEY_ALREADY_EXISTS`) and the history has one payment reply. A payment reply `DECLINED` after `APPROVED` was applied is 409 `Conflicting reply: PAYMENT was applied as APPROVED, not DECLINED`. A reply or GET for an unknown `processId` is 404; after `COMPLETED` a late invoice or payment reply is 409 and the history keeps its six entries. An unknown outcome is 400 and does not move the process; a payment command that cannot be sent (mocked `HTTP:CONNECTIVITY`) answers 503 with the `processId` and `SUSPENDED` in the body and leaves the process `SUSPENDED`, and a reply for it is then 409. When the payment reply is applied (a spy writes the newer state) before the send error is handled, the process stays `RUNNING` at `STOCK`. A payment reply whose stock command cannot be sent gets 200 `APPLIED` with status `SUSPENDED`. A refund reply `FAILED` ends `COMPENSATION_FAILED` and a later reply is 409. A reply the payment service cannot deliver (reply endpoint mocked unreachable) is logged and the process stays `RUNNING` at `PAYMENT`. +What the wave 7 suites show, observed on Mule 4.9.17 with MUnit 3.7.1 and File connector 1.5.7: + +- Wire tap: with the audit system off the inline version answers 503 and does not accept the order, and the tapped version answers 201 and logs the copy as not confirmed; the refused copy is not sent again once the system is back. With the audit system 3000 ms slow the tapped order is answered before the copy arrives. With it slower than the 5000 ms timeout, the inline order gets 504 and is not accepted, the tapped order is accepted, and in both the copy is recorded afterwards. A mocked tap call that rewrites the branch's payload and variables changes neither the main flow's answer nor its variables. +- File transfer: a half-written file under its temporary name is still there, unread, after several polls; at the moment of the rename the inbox holds only the complete temporary file. A second export of a name still waiting, or one being written, gets 409; concurrent exports of different ids are all accepted, and of concurrent exports of one id exactly one is. A failed publication leaves no temporary file; a nested order field gets 400; a symbolic link or a directory with a matching name is not read; the same name sent again after consumption leaves two files in `processed` under different names. When recording the rows fails, the file stays in the inbox and is read again; it is neither processed nor rejected. + Notes: - Object stores are in memory so every run starts clean, except the guaranteed delivery outbox, delivered and dead stores and the process manager's process and receipts stores, declared persistent because surviving a restart is the point (the connector's guarantee; the suites clear them before each test). In production use a persistent, shared store (Object Store v2 on CloudHub): an in-memory store is lost on restart and is not shared between replicas. @@ -168,7 +180,7 @@ Notes: ``` src/main/mule/ - global.xml shared: HTTP listener, properties, error handler (400/404/409/503 as JSON) + global.xml shared: HTTP listener, properties, error handler (400/404/409/503/504 as JSON) solid/ SOLID in MuleSoft srp/ ocp/ lsp/ isp/ dip/ -before.xml @@ -238,10 +250,16 @@ src/main/mule/ process-manager/ process-manager.xml trigger, reply endpoint with the next-step decision, persistent process state process-manager-services.xml simulated payment, stock, invoice and refund services that reply asynchronously -src/main/resources/config/app.yaml port, OCP payment routing, DIP repository choice, EIP self-call host, callback path, routing, claim check, request-reply, polling and competing consumers, guaranteed delivery, message expiration and process manager settings + wire-tap/ + wire-tap.xml inline audit write (before) vs Async tap with its own error handler (after) + wire-tap-audit.xml simulated audit system that can be slow or switched off + file-transfer/ + file-transfer.xml CSV producer (temporary name, rename), File listener consumer, results lookup +src/main/resources/config/app.yaml port, OCP payment routing, DIP repository choice, EIP self-call host, callback path, routing, claim check, request-reply, polling and competing consumers, guaranteed delivery, message expiration, wire tap, file transfer and process manager settings src/main/resources/dwl/ translator/PartnerProducts.dwl partner product codes -> SKUs (message translator) canonical/ CanonicalOrder (type, validation), FromMarketplace, FromPartnerXml, ToInvoicing, ToWarehouse +src/test/java/ test helper that creates a symbolic link (file transfer suite) src/test/munit/ solid/-test-suite.xml eip/-test-suite.xml diff --git a/docs/architecture.md b/docs/architecture.md index 9fa7424..43dfa2c 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -12,6 +12,7 @@ flowchart LR Solid --> Sim[Simulated systems inside the app] Eip --> Sim Eip --> Store[(Object stores)] + Eip --> Dir[(Local directories, file transfer)] Config[config/app.yaml] -.-> App Articles[Articles on brunosouzas.com] -.->|cite paths and endpoints| App ``` @@ -51,10 +52,13 @@ The open/closed example uses the same idea: `payment.flow.` in `app.yaml | `src/main/resources/config/app.yaml` | Port, OCP payment routing, DIP repository choice and the EIP settings | | `src/main/resources/dwl/` | DataWeave modules of the translation examples | | `src/test/munit/solid/`, `src/test/munit/eip/` | MUnit suites, one per principle or pattern | +| `src/test/java/` | A test-only helper that creates a symbolic link for the file transfer suite, which Mule has no operation for | | `docs/contracts/solid/` | RAML types of the LSP and ISP examples; documentation, not loaded by the app | | `requests.http` | Sample requests | -The global error handler answers `APP:BAD_REQUEST` with 400, `APP:NOT_FOUND` with 404, `APP:CONFLICT` with 409, `APP:SERVICE_UNAVAILABLE` with 503, `APP:COMPENSATION_FAILED` and any other error with 500, as JSON. +The global error handler answers `APP:BAD_REQUEST` with 400, `APP:NOT_FOUND` with 404, `APP:CONFLICT` with 409, `APP:SERVICE_UNAVAILABLE` with 503, `APP:GATEWAY_TIMEOUT` with 504, `APP:COMPENSATION_FAILED` and any other error with 500, as JSON. + +The file transfer example is the only one that uses the file system: its producer and consumer share an inbox directory (`eip.fileTransfer.*` in `app.yaml`; the inbox must exist at startup and defaults to the OS temporary directory). MUnit points the three directories under `target/` through system properties in [`pom.xml`](../pom.xml). What each pattern example does is described in the [README](../README.md). diff --git a/pom.xml b/pom.xml index 01eda30..cf88fa4 100644 --- a/pom.xml +++ b/pom.xml @@ -27,6 +27,7 @@ 1.11.3 1.3.2 1.1.5 + 1.5.7 @@ -59,6 +60,13 @@ ${app.runtime} MULE_EE + + + ${project.build.directory}/munit-file-transfer/inbox + ${project.build.directory}/munit-file-transfer/processed + ${project.build.directory}/munit-file-transfer/error + http.port @@ -97,6 +105,13 @@ ${mule.aggregators.module.version} mule-plugin + + + org.mule.connectors + mule-file-connector + ${mule.file.connector.version} + mule-plugin + com.mulesoft.munit munit-runner diff --git a/requests.http b/requests.http index aec1d97..fcd8e0c 100644 --- a/requests.http +++ b/requests.http @@ -360,3 +360,76 @@ POST {{base}}/eip/process-manager/replies Content-Type: application/json { "processId": "PM-replace-me", "step": "INVOICE", "outcome": "ISSUED" } + +### EIP wire tap — switch the simulated audit system off, then compare the inline write (503) with the tap (201) +PUT {{base}}/eip/wire-tap/audit/availability +Content-Type: application/json + +{ "available": false } + +### +POST {{base}}/eip/wire-tap/inline/orders +Content-Type: application/json + +{ "orderId": "ORD-7001", "amount": 120 } + +### +POST {{base}}/eip/wire-tap/orders +Content-Type: application/json + +{ "orderId": "ORD-7002", "amount": 120 } + +### +# Slow audit (3 s): the inline write waits, the tap answers at once +PUT {{base}}/eip/wire-tap/audit/availability +Content-Type: application/json + +{ "available": true, "delayMillis": 3000 } + +### +POST {{base}}/eip/wire-tap/inline/orders +Content-Type: application/json + +{ "orderId": "ORD-7003", "amount": 80 } + +### +POST {{base}}/eip/wire-tap/orders +Content-Type: application/json + +{ "orderId": "ORD-7004", "amount": 80 } + +### +# The copies received; the one refused while the audit system was off never arrives +GET {{base}}/eip/wire-tap/audit/copies + +### +PUT {{base}}/eip/wire-tap/audit/availability +Content-Type: application/json + +{ "available": true, "delayMillis": 0 } + +### +# The simulated audit system's own endpoint, called by both order flows +POST {{base}}/eip/wire-tap/audit/copies +Content-Type: application/json + +{ "orderId": "ORD-7005", "amount": 10 } + +### EIP file transfer — export a CSV file; the consumer reads it within about a second +POST {{base}}/eip/billing/exports +Content-Type: application/json + +{ "exportId": "EXP-7101", "orders": [ { "orderId": "ORD-7101", "customerId": "C-1", "amount": 120.5, "currency": "BRL" }, { "orderId": "ORD-7102", "customerId": "C-2", "amount": 80, "currency": "EUR" } ] } + +### +# A row without customerId and with a negative amount: the consumer rejects the whole file +POST {{base}}/eip/billing/exports +Content-Type: application/json + +{ "exportId": "EXP-7102", "orders": [ { "orderId": "ORD-7103", "amount": -5, "currency": "BRL" } ] } + +### +GET {{base}}/eip/billing/imports + +### +GET {{base}}/eip/billing/rejected-files diff --git a/src/main/mule/eip/file-transfer/file-transfer.xml b/src/main/mule/eip/file-transfer/file-transfer.xml new file mode 100644 index 0000000..fecf466 --- /dev/null +++ b/src/main/mule/eip/file-transfer/file-transfer.xml @@ -0,0 +1,299 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + orderId: order.orderId, + customerId: order.customerId, + amount: order.amount, + currency: order.currency +}]]> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0 else false +--- +if (isEmpty(lines)) ["the file is empty"] +else if (lines[0] != header) ["the header must be $(header)"] +else if (isEmpty(rows)) ["the file has no rows"] +else flatten(rows map (row, index) -> rowViolations(row, index + 2))]]> + + + + + + + { + orderId: row.orderId, + customerId: row.customerId, + amount: row.amount as Number, + currency: row.currency +}]]> + + + + + + + + + + + + + + + file.rows map (row) -> row ++ { fileName: file.fileName, archivedAs: file.archivedAs, importedAt: file.importedAt })]]> + + + + + + + + + + + + diff --git a/src/main/mule/eip/wire-tap/wire-tap-audit.xml b/src/main/mule/eip/wire-tap/wire-tap-audit.xml new file mode 100644 index 0000000..ccaf39c --- /dev/null +++ b/src/main/mule/eip/wire-tap/wire-tap-audit.xml @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/mule/eip/wire-tap/wire-tap.xml b/src/main/mule/eip/wire-tap/wire-tap.xml new file mode 100644 index 0000000..8896cd4 --- /dev/null +++ b/src/main/mule/eip/wire-tap/wire-tap.xml @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/main/mule/global.xml b/src/main/mule/global.xml index a03869f..3fc9350 100644 --- a/src/main/mule/global.xml +++ b/src/main/mule/global.xml @@ -16,7 +16,7 @@ - + @@ -58,6 +58,17 @@ output application/json + + + + + + + + diff --git a/src/main/resources/config/app.yaml b/src/main/resources/config/app.yaml index d635fa6..bc03326 100644 --- a/src/main/resources/config/app.yaml +++ b/src/main/resources/config/app.yaml @@ -76,3 +76,21 @@ eip: processManager: paymentLimit: "1000" replyPath: "/eip/process-manager/replies" + # Wire tap: how long a call to the simulated audit system may take, inline or tapped, before it fails. + wireTap: + auditTimeoutMillis: "5000" + # File transfer: the directory the billing producer writes to (inbox) and where the consumer moves each file + # after reading it (processed or error). The inbox must exist when the application starts, so its default is + # the operating system's temporary directory itself; processed and error are created on the first move. So + # the app runs on any machine with no setup. Where the temporary directory is shared, none of the three is + # private to the application. With the sticky bit (/tmp on Linux), another user's regular file with a matching + # name is imported, and a file the application cannot move is read again on every poll for as long as it runs + # (symbolic links and directories are never read). Point all three at private directories outside a demo. A + # real integration uses + # directories both applications can reach and that survive a restart. + fileTransfer: + inboxDirectory: "${java.io.tmpdir}" + processedDirectory: "${java.io.tmpdir}/mulesoft-patterns-examples/billing/processed" + errorDirectory: "${java.io.tmpdir}/mulesoft-patterns-examples/billing/error" + # How often the consumer looks for new files. + pollFrequencyMillis: "1000" diff --git a/src/test/java/com/brunosouzas/examples/test/SymbolicLinks.java b/src/test/java/com/brunosouzas/examples/test/SymbolicLinks.java new file mode 100644 index 0000000..252cab6 --- /dev/null +++ b/src/test/java/com/brunosouzas/examples/test/SymbolicLinks.java @@ -0,0 +1,16 @@ +package com.brunosouzas.examples.test; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Path; + +/** Test helper: Mule has no operation that creates a symbolic link. */ +public final class SymbolicLinks { + + private SymbolicLinks() { + } + + public static String create(String link, String target) throws IOException { + return Files.createSymbolicLink(Path.of(link), Path.of(target)).toString(); + } +} diff --git a/src/test/munit/eip/file-transfer-test-suite.xml b/src/test/munit/eip/file-transfer-test-suite.xml new file mode 100644 index 0000000..962eeb7 --- /dev/null +++ b/src/test/munit/eip/file-transfer-test-suite.xml @@ -0,0 +1,606 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/test/munit/eip/wire-tap-test-suite.xml b/src/test/munit/eip/wire-tap-test-suite.xml new file mode 100644 index 0000000..3560ab7 --- /dev/null +++ b/src/test/munit/eip/wire-tap-test-suite.xml @@ -0,0 +1,517 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +