File tree Expand file tree Collapse file tree
src/test/java/io/getstream Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -938,35 +938,6 @@ void testChannelBatchUpdate() throws Exception {
938938 }
939939 }
940940
941- @ Test
942- @ Order (20 )
943- void testSetRetentionPolicy () throws Exception {
944- try {
945- var resp =
946- client
947- .chat ()
948- .setRetentionPolicy (
949- SetRetentionPolicyRequest .builder ()
950- .policy ("old-messages" )
951- .maxAgeHours (720 )
952- .build ())
953- .execute ();
954-
955- assertNotNull (resp .getData (), "SetRetentionPolicy response should not be null" );
956- assertNotNull (resp .getData ().getDuration (), "Duration should not be null" );
957- assertNotNull (resp .getData ().getPolicy (), "Policy should not be null" );
958- } catch (Exception e ) {
959- String msg = e .getMessage () != null ? e .getMessage () : "" ;
960- Assumptions .assumeTrue (
961- !msg .contains ("not available" )
962- && !msg .contains ("not supported" )
963- && !msg .contains ("not enabled" )
964- && !msg .contains ("retention" ),
965- "Retention policy feature not available on this app: " + msg );
966- throw e ;
967- }
968- }
969-
970941 @ Test
971942 @ Order (21 )
972943 void testGetRetentionPolicy () throws Exception {
@@ -1018,6 +989,16 @@ void testGetRetentionPolicyRuns() throws Exception {
1018989 @ Order (23 )
1019990 void testDeleteRetentionPolicy () throws Exception {
1020991 try {
992+ // Create a policy first so we have something to delete
993+ client
994+ .chat ()
995+ .setRetentionPolicy (
996+ SetRetentionPolicyRequest .builder ()
997+ .policy ("old-messages" )
998+ .maxAgeHours (720 )
999+ .build ())
1000+ .execute ();
1001+
10211002 var resp =
10221003 client
10231004 .chat ()
You can’t perform that action at this time.
0 commit comments