Skip to content

Commit dc3e3d2

Browse files
committed
Merge branch 'issue/CDM-20' into issue/CDM-22
2 parents 9010922 + f0c77c8 commit dc3e3d2

File tree

3 files changed

+17
-16
lines changed

3 files changed

+17
-16
lines changed

.github/workflows/docker-publish.yml

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
11
name: Build and publish to docker repo
22

3-
on:
4-
workflow_dispatch:
5-
push:
6-
branches:
7-
- main
8-
paths:
9-
- 'src/**'
10-
- 'pom.xml'
11-
- 'Dockerfile'
12-
- 'LICENSE.md'
13-
tags:
14-
- '*.*.*'
15-
- '*.*.*-*'
3+
on: workflow_dispatch
164

175
jobs:
186
build_and_publish:
@@ -50,4 +38,4 @@ jobs:
5038
context: .
5139
push: true
5240
tags: ${{ steps.meta.outputs.tags }}
53-
platforms: linux/amd64
41+
platforms: linux/amd64

src/main/java/datastax/astra/migrate/cql/CqlHelper.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -476,4 +476,11 @@ private void abendIfSessionsNotSet() {
476476
public Feature getFeature(Featureset featureEnum) {
477477
return featureMap.get(featureEnum);
478478
}
479+
480+
public Boolean isFeatureEnabled(Featureset featureEnum) {
481+
if (!featureMap.containsKey(featureEnum)) {
482+
return false;
483+
}
484+
return featureMap.get(featureEnum).isEnabled();
485+
}
479486
}

src/test/java/datastax/astra/migrate/CqlHelperTest.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package datastax.astra.migrate;
22

33
import datastax.astra.migrate.cql.CqlHelper;
4+
import datastax.astra.migrate.cql.features.Featureset;
45
import datastax.astra.migrate.properties.KnownProperties;
56
import datastax.astra.migrate.properties.PropertyHelper;
67
import org.apache.spark.SparkConf;
78
import org.junit.jupiter.api.AfterEach;
89
import org.junit.jupiter.api.BeforeEach;
910
import org.junit.jupiter.api.Test;
1011

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.*;
1313

1414
public class CqlHelperTest {
1515

@@ -54,4 +54,10 @@ public void smokeTest() {
5454
);
5555
}
5656

57+
@Test
58+
public void featureHelper_disabledWhenNull() {
59+
propertyHelper.initializeSparkConf(sparkConf);
60+
cqlHelper.initialize();
61+
assertFalse(cqlHelper.isFeatureEnabled(Featureset.TEST_UNIMPLEMENTED_FEATURE));
62+
}
5763
}

0 commit comments

Comments
 (0)