@@ -44,21 +44,6 @@ void whenCallingGetAppAsync_thenNoException() {
4444 @ DisplayName ("App Settings update does not throw Exception" )
4545 @ Test
4646 void whenUpdatingAppSettings_thenNoException () {
47- Assertions .assertDoesNotThrow (
48- () ->
49- App .update ()
50- .disableAuthChecks (true )
51- .disablePermissionsChecks (true )
52- .asyncModerationConfig (
53- App .AsyncModerationConfigRequestObject .builder ()
54- .callback (
55- App .AsyncModerationCallback .builder ()
56- .mode ("CALLBACK_MODE_REST" )
57- .serverUrl ("http://localhost.com" )
58- .build ())
59- .timeoutMs (3000 )
60- .build ())
61- .request ());
6247 Assertions .assertDoesNotThrow (
6348 () -> App .update ().disableAuthChecks (false ).disablePermissionsChecks (false ).request ());
6449 }
@@ -258,6 +243,30 @@ void whenUpdatingAppSettingsWithSNSEventHook_thenNoException() throws StreamExce
258243 }
259244 }
260245
246+ @ DisplayName ("Can update app settings with pending message event hook" )
247+ @ Test
248+ void whenUpdatingAppSettingsWithPendingMessageEventHook_thenNoException () throws StreamException {
249+ EventHook pendingMessageHook = new EventHook ();
250+ pendingMessageHook .setId ("5944d247-8b4f-4108-a970-fe1d11fca989" );
251+ pendingMessageHook .setHookType (App .HookType .PENDING_MESSAGE );
252+ pendingMessageHook .setEnabled (true );
253+ pendingMessageHook .setWebhookURL ("https://example.com/pending-message-webhook" );
254+ pendingMessageHook .setTimeoutMs (3000 );
255+
256+ App .PendingMessageCallback callback = new App .PendingMessageCallback ();
257+ callback .setMode (App .CallbackMode .REST );
258+ pendingMessageHook .setCallback (callback );
259+
260+ try {
261+ App .update ().eventHooks (Collections .singletonList (pendingMessageHook )).request ();
262+ } catch (StreamException e ) {
263+ if (e .getMessage ().contains ("cannot set event hooks in hook v1 system" )) {
264+ return ;
265+ }
266+ throw e ;
267+ }
268+ }
269+
261270 @ DisplayName ("AppConfig encoding should not include null fields" )
262271 @ Test
263272 void whenEncodingAppConfig_thenNoNullFields () {
0 commit comments