Skip to content

Commit 808b165

Browse files
author
Max Gruenfelder
committed
add test
1 parent bd1aea3 commit 808b165

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

docs/setup/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ The table includes the parameter name, a description of its purpose, and the def
7373
| disableRedis | Whether or not to disable Redis. | false | no |
7474
| updatePeriodicEvents | Whether or not to update periodic events. | true | no |
7575
| thresholdLoggingEventProcessing [ms] | Threshold after how many milliseconds the processing of a event or periodic event is logged for observability. | 50 | yes |
76-
| useAsCAPOutbox | Uses the event-queue as the [outbox](https://cap.cloud.sap/docs/node.js/outbox) of CAP. Outbox called are stored and processed in the event-queue instead of the outbox of CAP. | false | no |
76+
| useAsCAPOutbox | Uses the event-queue as the [outbox](https://cap.cloud.sap/docs/node.js/outbox) of CAP. Outbox calls are stored and processed in the event-queue instead of the outbox of CAP. | false | no |
7777
| userId | User id for all created cds contexts. This influences the value for updated managed database fields like createdBy and modifiedBy. | false | yes |
7878
| cleanupLocksAndEventsForDev | Deletes all semantic locks and sets all events that are in progress to error during server start. This is used to clean up leftovers from server crashes or restarts during processing. | false | no |
7979
| redisOptions | The option is provided to customize settings when creating Redis clients. The object is spread at the root level for creating a client and within the `default` options for cluster clients. | {} | no |

test/baseFunctionality.test.js

+9
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,15 @@ describe("baseFunctionality", () => {
6868
await cds.tx({}, (tx) => testHelper.selectEventQueueAndExpectDone(tx));
6969
});
7070

71+
test("insert one entry and process with null as payload", async () => {
72+
const event = testHelper.getEventEntry();
73+
event.payload = null;
74+
await cds.tx({}, (tx) => eventQueue.publishEvent(tx, event));
75+
await eventQueue.processEventQueue(context, event.type, event.subType);
76+
expect(loggerMock.callsLengths().error).toEqual(0);
77+
await cds.tx({}, (tx) => testHelper.selectEventQueueAndExpectDone(tx));
78+
});
79+
7180
test("should not process events that are suspended", async () => {
7281
await cds.tx({}, (tx) => testHelper.insertEventEntry(tx, { status: EventProcessingStatus.Suspended }));
7382
const event = eventQueue.config.events[0];

0 commit comments

Comments
 (0)