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
1 change: 1 addition & 0 deletions src/controllers/event/fulfillment.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ function FulfillmentController(context) {
const FULFILLMENT_EVENT_TYPES = {
EDGE_DELIVERY_SERVICES: 'edge-delivery-services',
AEM_SITES_OPTIMIZER: 'aem-sites-optimizer',
LLM_OPTIMIZER: 'llm-optimizer',
};

async function queueEventsForProcessing(hoolihanEventArray, eventType) {
Expand Down
11 changes: 11 additions & 0 deletions test/controllers/event/fulfillment.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,17 @@ describe('Fulfillment Controller', () => {
expect(results[0].status).to.equal('accepted');
});

it('accepts valid event types (llm-optimizer)', async () => {
const eventArray = localFileToObject('sample-hoolihan-event.json');
const response = await fulfillmentController.processFulfillmentEvents({
data: eventArray,
params: { eventType: 'llm-optimizer' },
});
expect(response.status).to.equal(202);
const results = await response.json();
expect(results[0].status).to.equal('accepted');
});

it('rejects invalid event types', async () => {
const eventArray = localFileToObject('sample-hoolihan-event.json');
const response = await fulfillmentController.processFulfillmentEvents({
Expand Down