2222
2323import com .datastax .oss .driver .api .core .CqlSession ;
2424import com .datastax .oss .driver .api .core .cql .Row ;
25+ import com .datastax .oss .driver .api .core .cql .SimpleStatement ;
2526import com .datastax .oss .driver .api .core .data .UdtValue ;
2627import com .datastax .oss .driver .api .core .type .UserDefinedType ;
2728import com .datastax .oss .driver .api .core .type .codec .TypeCodec ;
2829import com .datastax .oss .driver .api .testinfra .ccm .CcmRule ;
2930import com .datastax .oss .driver .api .testinfra .session .SessionRule ;
3031import com .datastax .oss .driver .categories .ParallelizableTests ;
32+ import java .time .Duration ;
3133import java .util .Objects ;
3234import org .junit .Rule ;
3335import org .junit .Test ;
@@ -47,8 +49,13 @@ public class UdtCodecIT {
4749 @ Test
4850 public void should_decoding_udt_be_backward_compatible () {
4951 CqlSession session = sessionRule .session ();
50- session .execute ("CREATE TYPE test_type_1 (a text, b int)" );
51- session .execute ("CREATE TABLE test_table_1 (e int primary key, f frozen<test_type_1>)" );
52+ session .execute (
53+ SimpleStatement .newInstance ("CREATE TYPE test_type_1 (a text, b int)" )
54+ .setTimeout (Duration .ofSeconds (20 )));
55+ session .execute (
56+ SimpleStatement .newInstance (
57+ "CREATE TABLE test_table_1 (e int primary key, f frozen<test_type_1>)" )
58+ .setTimeout (Duration .ofSeconds (20 )));
5259 // insert a row using version 1 of the UDT schema
5360 session .execute ("INSERT INTO test_table_1(e, f) VALUES(1, {a: 'a', b: 1})" );
5461 UserDefinedType udt =
@@ -59,7 +66,9 @@ public void should_decoding_udt_be_backward_compatible() {
5966 .orElseThrow (IllegalStateException ::new );
6067 TypeCodec <?> oldCodec = session .getContext ().getCodecRegistry ().codecFor (udt );
6168 // update UDT schema
62- session .execute ("ALTER TYPE test_type_1 add i text" );
69+ session .execute (
70+ SimpleStatement .newInstance ("ALTER TYPE test_type_1 add i text" )
71+ .setTimeout (Duration .ofSeconds (20 )));
6372 // insert a row using version 2 of the UDT schema
6473 session .execute ("INSERT INTO test_table_1(e, f) VALUES(2, {a: 'b', b: 2, i: 'b'})" );
6574 Row row =
0 commit comments