File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
main/java/datastax/astra/migrate/cql
test/java/datastax/astra/migrate Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -457,4 +457,11 @@ private void abendIfSessionsNotSet() {
457
457
public Feature getFeature (Featureset featureEnum ) {
458
458
return featureMap .get (featureEnum );
459
459
}
460
+
461
+ public Boolean isFeatureEnabled (Featureset featureEnum ) {
462
+ if (!featureMap .containsKey (featureEnum )) {
463
+ return false ;
464
+ }
465
+ return featureMap .get (featureEnum ).isEnabled ();
466
+ }
460
467
}
Original file line number Diff line number Diff line change 1
1
package datastax .astra .migrate ;
2
2
3
3
import datastax .astra .migrate .cql .CqlHelper ;
4
+ import datastax .astra .migrate .cql .features .Featureset ;
4
5
import datastax .astra .migrate .properties .KnownProperties ;
5
6
import datastax .astra .migrate .properties .PropertyHelper ;
6
7
import org .apache .spark .SparkConf ;
7
8
import org .junit .jupiter .api .AfterEach ;
8
9
import org .junit .jupiter .api .BeforeEach ;
9
10
import org .junit .jupiter .api .Test ;
10
11
11
- import static org .junit .jupiter .api .Assertions .assertAll ;
12
- import static org .junit .jupiter .api .Assertions .assertEquals ;
12
+ import static org .junit .jupiter .api .Assertions .*;
13
13
14
14
public class CqlHelperTest {
15
15
@@ -54,4 +54,10 @@ public void smokeTest() {
54
54
);
55
55
}
56
56
57
+ @ Test
58
+ public void featureHelper_disabledWhenNull () {
59
+ propertyHelper .initializeSparkConf (sparkConf );
60
+ cqlHelper .initialize ();
61
+ assertFalse (cqlHelper .isFeatureEnabled (Featureset .TEST_UNIMPLEMENTED_FEATURE ));
62
+ }
57
63
}
You can’t perform that action at this time.
0 commit comments