Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Christoph Pirkl <[email protected]>
  • Loading branch information
pj-spoelders and kaklakariada authored Oct 11, 2023
1 parent 014a64d commit 3c226a7
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 18 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,3 @@ pom.xml.versionsBackup
/extension-test.properties

/.testcontainers-tmp-*

.settings
6 changes: 0 additions & 6 deletions extension/src/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ describe("Kafka Connector Extension", () => {
function setScript(name: string, className: string, version = EXTENSION_DESCRIPTION.version): ExaScriptsRow {
return script({ name, inputType: "SET", text: text(name, className, version) })
}
function scalarScript(name: string, className: string, version = EXTENSION_DESCRIPTION.version): ExaScriptsRow {
return script({ name, inputType: "SCALAR", text: text(name, className, version) })
}

it("returns empty list when no adapter script is available", () => {
expect(findInstallations([])).toHaveLength(0)
Expand All @@ -85,9 +82,6 @@ describe("Kafka Connector Extension", () => {
]
expect(() => findInstallations(scripts)).toThrowError(new PreconditionFailedError(`Not all scripts use the same version. Found 2 different versions: '${currentVersion}, 0.0.0'`))
})

describe("returns expected installations", () => {
})
})

describe("install()", () => {
Expand Down
7 changes: 5 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
<java.version>11</java.version>
<scala.version>2.13.3</scala.version>
<scala.compat.version>2.13</scala.compat.version>
<sonar.sources>.</sonar.sources>
<sonar.inclusions>src/main/**</sonar.inclusions>
<sonar.sources>src/main/,extension/src/</sonar.sources>
<sonar.exclusions>extension/src/*.test.ts</sonar.exclusions>
<sonar.tests>src/test/,extension/src</sonar.tests>
<sonar.test.inclusions>src/test/,*.test.ts</sonar.test.inclusions>
<sonar.javascript.lcov.reportPaths>extension/coverage/lcov.info</sonar.javascript.lcov.reportPaths>
</properties>
<repositories>
<repository>
Expand Down Expand Up @@ -212,6 +214,7 @@
<groupId>org.apache.kafka</groupId>
<artifactId>kafka-clients</artifactId>
<version>3.5.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
Expand Down
9 changes: 1 addition & 8 deletions src/test/java/com/exasol/cloudetl/kafka/ExtensionIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ private void assertInstalledVersion(final String expectedName, final String expe
final List<InstallationsResponseInstallation> installations = setup.client().getInstallations();
final InstallationsResponseInstallation expectedInstallation = new InstallationsResponseInstallation()
.name(expectedName).version(expectedVersion);
// The extension is installed twice (previous and current version), so each one returns the same installation.
// The extension definition is installed twice (previous and current version), so each one returns the same installation.
assertAll(() -> assertThat(installations, hasSize(2)),
() -> assertThat(installations.get(0), equalTo(expectedInstallation)),
() -> assertThat(installations.get(1), equalTo(expectedInstallation)));
Expand All @@ -241,18 +241,11 @@ private PreviousExtensionVersion createPreviousVersion() {

private void verifyImportWorks() {
final ExasolSchema schema = exasolObjectFactory.createSchema("TESTING_SCHEMA_" + System.currentTimeMillis());

try {

final Table targetTable = schema.createTableBuilder("TARGET")

.column("SENSOR_ID", "INTEGER").column("STATUS", "VARCHAR(10)") //
.column("KAFKA_PARTITION", "DECIMAL(18, 0)").column("KAFKA_OFFSET", "DECIMAL(36, 0)").build();
// CREATE CONNECTION (optional, see
// https://github.com/exasol/kafka-connector-extension/blob/main/doc/user_guide/user_guide.md#importing-records)

executeKafkaImport(targetTable, kafkaSetup);

assertQueryResult(
"select sensor_id, status, kafka_partition,kafka_offset from " + targetTable.getFullyQualifiedName()
+ " order by sensor_id",
Expand Down

0 comments on commit 3c226a7

Please sign in to comment.