Poorvankbhatia commented on code in PR #39:
URL:
https://github.com/apache/flink-connector-cassandra/pull/39#discussion_r2421175992
##########
flink-connector-cassandra/pom.xml:
##########
@@ -44,7 +44,7 @@ under the License.
<junit5.version>5.8.1</junit5.version>
<assertj.version>3.23.1</assertj.version>
<archunit.version>1.0.0</archunit.version>
- <testcontainers.version>1.18.3</testcontainers.version>
+ <testcontainers.version>1.20.2</testcontainers.version>
Review Comment:
nit: Should we add an inline comment here explaining why testcontainers
1.20.2+ is required (prevents accidental downgrade).
##########
flink-connector-cassandra/src/test/java/org/apache/flink/connector/cassandra/table/CassandraDynamicTableSourceITCase.java:
##########
@@ -45,12 +45,12 @@
@ExtendWith(MiniClusterExtension.class)
class CassandraDynamicTableSourceITCase {
- private CassandraTestEnvironment cassandraTestEnvironment;
- private StreamTableEnvironment tableEnv;
+ private static final CassandraTestEnvironment cassandraTestEnvironment =
+ new CassandraTestEnvironment(false);
+ private static StreamTableEnvironment tableEnv;
- @BeforeEach
- void setUp() throws Exception {
- cassandraTestEnvironment = new CassandraTestEnvironment(false);
+ @BeforeAll
Review Comment:
Nice optimization! The move from `@BeforeEach`/`@AfterEach` to
`@BeforeAll`/`@AfterAll` will reduce test execution time.
Just one suggestion: Instead of making everything static, consider using
[@TestInstance(PER_CLASS)](https://docs.junit.org/5.0.0/api/org/junit/jupiter/api/TestInstance.Lifecycle.html#PER_CLASS)
in the class.
That lets @BeforeAll / @AfterAll be instance methods and keeps
CassandraTestEnvironment, StreamTableEnvironment, and helper methods
as normal instance members — cleaner and avoids unnecessary static state. I
have not tried it though, as it is purely a style/maintainability suggestion.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]