@@ -184,20 +184,24 @@ void whenUpdatingAppSettingsSizeLimit_thenNoException() {
184184 Assertions .assertEquals (newSizeLimit , appConfig .getFileUploadConfig ().getSizeLimit ());
185185 }
186186
187- @ DisplayName ("Can update app settings with webhook event hook " )
187+ @ DisplayName ("Can update app settings with webhook event hooks with different products " )
188188 @ Test
189- void whenUpdatingAppSettingsWithWebhookEventHook_thenNoException () throws StreamException {
190- EventHook webhookHook = new EventHook ();
191- webhookHook .setId ("webhook-1" );
192- webhookHook .setHookType (App .HookType .WEBHOOK );
193- webhookHook .setEnabled (true );
194- webhookHook .setEventTypes (Arrays .asList ("message.new" , "message.updated" ));
195- webhookHook .setWebhookURL ("https://example.com/webhook" );
196- webhookHook .setCreatedAt (new Date ());
197- webhookHook .setUpdatedAt (new Date ());
189+ void whenUpdatingAppSettingsWithWebhookEventHooks_thenNoException () throws StreamException {
190+ EventHook defaultWebhookHook = new EventHook ();
191+ defaultWebhookHook .setHookType (App .HookType .WEBHOOK );
192+ defaultWebhookHook .setEnabled (true );
193+ defaultWebhookHook .setEventTypes (Arrays .asList ("message.new" , "message.updated" ));
194+ defaultWebhookHook .setWebhookURL ("https://example.com/webhook-default" );
195+
196+ EventHook chatWebhookHook = new EventHook ();
197+ chatWebhookHook .setHookType (App .HookType .WEBHOOK );
198+ chatWebhookHook .setEnabled (true );
199+ chatWebhookHook .setEventTypes (Arrays .asList ("message.new" , "message.updated" ));
200+ chatWebhookHook .setWebhookURL ("https://example.com/webhook-chat" );
201+ chatWebhookHook .setProduct (App .Product .CHAT );
198202
199203 try {
200- App .update ().eventHooks (Collections . singletonList ( webhookHook )).request ();
204+ App .update ().eventHooks (Arrays . asList ( defaultWebhookHook , chatWebhookHook )).request ();
201205 } catch (StreamException e ) {
202206 if (e .getMessage ().contains ("cannot set event hooks in hook v1 system" )) {
203207 return ;
0 commit comments