@@ -34,6 +34,7 @@ public class TTLAndWritetimeTest extends CommonMocks {
34
34
35
35
WritetimeTTL feature ;
36
36
Long customWritetime = 123456789L ;
37
+ Long customTTL = 1000L ;
37
38
Long filterMin = 100000000L ;
38
39
Long filterMax = 200000000L ;
39
40
String writetimeColumnName = "writetime_col" ;
@@ -69,6 +70,7 @@ private void setTestWhens(){
69
70
String argument = invocation .getArgument (0 );
70
71
return originValueColumns .contains (argument );
71
72
});
73
+ when (propertyHelper .getLong (KnownProperties .TRANSFORM_CUSTOM_TTL )).thenReturn (customTTL );
72
74
}
73
75
74
76
@@ -83,6 +85,7 @@ public void smoke_loadProperties() {
83
85
assertAll (
84
86
() -> assertTrue (feature .isEnabled (), "enabled" ),
85
87
() -> assertEquals (customWritetime , feature .getCustomWritetime (), "customWritetime" ),
88
+ () -> assertEquals (customTTL , feature .getCustomTTL (), "customTTL" ),
86
89
() -> assertTrue (feature .hasWriteTimestampFilter (), "hasWriteTimestampFilter" ),
87
90
() -> assertTrue (feature .hasWritetimeColumns (), "hasWritetimeColumns with custom writetime" ),
88
91
() -> assertEquals (customWritetime , feature .getCustomWritetime (), "customWritetime is set" ),
@@ -113,6 +116,7 @@ public void smokeTest_disabledFeature() {
113
116
when (propertyHelper .getLong (KnownProperties .FILTER_WRITETS_MAX )).thenReturn (null );
114
117
when (propertyHelper .getStringList (KnownProperties .ORIGIN_TTL_NAMES )).thenReturn (null );
115
118
when (propertyHelper .getLong (KnownProperties .TRANSFORM_CUSTOM_WRITETIME )).thenReturn (null );
119
+ when (propertyHelper .getLong (KnownProperties .TRANSFORM_CUSTOM_TTL )).thenReturn (null );
116
120
when (propertyHelper .getStringList (KnownProperties .ORIGIN_WRITETIME_NAMES )).thenReturn (null );
117
121
when (propertyHelper .getBoolean (KnownProperties .ORIGIN_WRITETIME_AUTO )).thenReturn (Boolean .FALSE );
118
122
when (propertyHelper .getBoolean (KnownProperties .ORIGIN_TTL_AUTO )).thenReturn (Boolean .FALSE );
@@ -135,6 +139,7 @@ public void smokeTest_enabledFeature_withOnlyWritetimeAuto() {
135
139
when (propertyHelper .getLong (KnownProperties .FILTER_WRITETS_MAX )).thenReturn (null );
136
140
when (propertyHelper .getStringList (KnownProperties .ORIGIN_TTL_NAMES )).thenReturn (null );
137
141
when (propertyHelper .getLong (KnownProperties .TRANSFORM_CUSTOM_WRITETIME )).thenReturn (null );
142
+ when (propertyHelper .getLong (KnownProperties .TRANSFORM_CUSTOM_TTL )).thenReturn (null );
138
143
when (propertyHelper .getStringList (KnownProperties .ORIGIN_WRITETIME_NAMES )).thenReturn (null );
139
144
when (propertyHelper .getBoolean (KnownProperties .ORIGIN_WRITETIME_AUTO )).thenReturn (Boolean .TRUE );
140
145
when (propertyHelper .getBoolean (KnownProperties .ORIGIN_TTL_AUTO )).thenReturn (Boolean .FALSE );
@@ -174,6 +179,7 @@ public void smokeTest_enabledFeature_withOnlyTTLAuto() {
174
179
@ Test
175
180
public void smoke_writetimeWithoutTTL () {
176
181
when (propertyHelper .getLong (KnownProperties .TRANSFORM_CUSTOM_WRITETIME )).thenReturn (0L );
182
+ when (propertyHelper .getLong (KnownProperties .TRANSFORM_CUSTOM_TTL )).thenReturn (null );
177
183
when (propertyHelper .getStringList (KnownProperties .ORIGIN_TTL_NAMES )).thenReturn (null );
178
184
when (propertyHelper .getLong (KnownProperties .FILTER_WRITETS_MIN )).thenReturn (filterMin );
179
185
when (propertyHelper .getLong (KnownProperties .FILTER_WRITETS_MAX )).thenReturn (filterMax );
@@ -225,6 +231,7 @@ public void smoke_ttlWithoutWritetime_withCustomWritetime() {
225
231
@ Test
226
232
public void smoke_autoWritetime_noCustomWritetime () {
227
233
when (propertyHelper .getLong (KnownProperties .TRANSFORM_CUSTOM_WRITETIME )).thenReturn (0L );
234
+ when (propertyHelper .getLong (KnownProperties .TRANSFORM_CUSTOM_TTL )).thenReturn (null );
228
235
when (propertyHelper .getStringList (KnownProperties .ORIGIN_WRITETIME_NAMES )).thenReturn (null );
229
236
when (propertyHelper .getBoolean (KnownProperties .ORIGIN_WRITETIME_AUTO )).thenReturn (true );
230
237
when (propertyHelper .getLong (KnownProperties .FILTER_WRITETS_MIN )).thenReturn (null );
@@ -244,6 +251,7 @@ public void smoke_autoWritetime_noCustomWritetime() {
244
251
@ Test
245
252
public void smoke_autoWritetime_CustomWritetime () {
246
253
when (propertyHelper .getLong (KnownProperties .TRANSFORM_CUSTOM_WRITETIME )).thenReturn (100L );
254
+ when (propertyHelper .getLong (KnownProperties .TRANSFORM_CUSTOM_TTL )).thenReturn (null );
247
255
when (propertyHelper .getStringList (KnownProperties .ORIGIN_WRITETIME_NAMES )).thenReturn (null );
248
256
when (propertyHelper .getBoolean (KnownProperties .ORIGIN_WRITETIME_AUTO )).thenReturn (true );
249
257
when (propertyHelper .getLong (KnownProperties .FILTER_WRITETS_MIN )).thenReturn (null );
@@ -373,6 +381,7 @@ public void getLargestWriteTimeStampWithCustomTimeTest() {
373
381
374
382
@ Test
375
383
public void getLargestTTLTest () {
384
+ when (propertyHelper .getLong (KnownProperties .TRANSFORM_CUSTOM_TTL )).thenReturn (null );
376
385
when (originTable .indexOf ("TTL(" +ttlColumnName +")" )).thenReturn (100 );
377
386
when (originRow .getInt (eq (100 ))).thenReturn (30 );
378
387
when (originTable .indexOf ("TTL(" +writetimeTTLColumnName +")" )).thenReturn (101 );
0 commit comments