From 605b06f9109ffb3d7d8bc3cc2f0c297b771b23da Mon Sep 17 00:00:00 2001 From: tplevko Date: Wed, 9 Oct 2024 10:17:09 +0200 Subject: [PATCH] fix(1541): Provide a template for removeHeaders EIP --- .../support/camel-component-default.service.test.ts | 10 ++++++++++ .../flows/support/camel-component-default.service.ts | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/packages/ui/src/models/visualization/flows/support/camel-component-default.service.test.ts b/packages/ui/src/models/visualization/flows/support/camel-component-default.service.test.ts index 3499b9812..f4b86423b 100644 --- a/packages/ui/src/models/visualization/flows/support/camel-component-default.service.test.ts +++ b/packages/ui/src/models/visualization/flows/support/camel-component-default.service.test.ts @@ -120,5 +120,15 @@ describe('CamelComponentDefaultService', () => { expect((filterDefault.filter!.expression as any).simple).toEqual({}); expect(filterDefault.filter!.steps).toBeUndefined(); }); + + it('should return the default value for a removeHeaders processor', () => { + const removeHeadersDefault = CamelComponentDefaultService.getDefaultNodeDefinitionValue({ + type: 'processor', + name: 'removeHeaders', + } as DefinedComponent) as any; + expect(removeHeadersDefault.removeHeaders).toBeDefined(); + expect(removeHeadersDefault.removeHeaders.id as string).toMatch(/^removeHeaders-/); + expect(removeHeadersDefault.removeHeaders.pattern).toEqual('*'); + }); }); }); diff --git a/packages/ui/src/models/visualization/flows/support/camel-component-default.service.ts b/packages/ui/src/models/visualization/flows/support/camel-component-default.service.ts index ffa81ed3f..5603e98b8 100644 --- a/packages/ui/src/models/visualization/flows/support/camel-component-default.service.ts +++ b/packages/ui/src/models/visualization/flows/support/camel-component-default.service.ts @@ -133,6 +133,13 @@ export class CamelComponentDefaultService { message: "\${body}" `); + case 'removeHeaders': + return parse(` + removeHeaders: + id: ${getCamelRandomId('removeHeaders')} + pattern: "*" + `); + case 'doCatch': return parse(` id: ${getCamelRandomId('doCatch')}