Skip to content

Commit

Permalink
Adapt tests to new Extension Manager
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada committed Oct 24, 2023
1 parent e84a54d commit 1c6697f
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import software.amazon.awssdk.core.sync.RequestBody;

class ExtensionIT {
private static final String PREVIOUS_VERSION = "2.8.0";
private static final String PREVIOUS_VERSION = "2.8.1";
private static final String PREVIOUS_VERSION_JAR_FILE = "document-files-virtual-schema-dist-7.3.3-s3-"
+ PREVIOUS_VERSION + ".jar";
private static final Path EXTENSION_SOURCE_DIR = Paths.get("extension").toAbsolutePath();
Expand Down Expand Up @@ -224,9 +224,9 @@ void upgradeFromPreviousVersion() throws InterruptedException, BucketAccessExcep
previousVersion.install();
final String virtualTable = createVirtualSchema(previousVersion.getExtensionId(), PREVIOUS_VERSION);
verifyVirtualTableContainsData(virtualTable);
assertInstalledVersion("EXA_EXTENSIONS.S3_FILES_ADAPTER", PREVIOUS_VERSION);
assertInstalledVersion("EXA_EXTENSIONS.S3_FILES_ADAPTER", PREVIOUS_VERSION, previousVersion.getExtensionId());
previousVersion.upgrade();
assertInstalledVersion("EXA_EXTENSIONS.S3_FILES_ADAPTER", PROJECT_VERSION);
assertInstalledVersion("EXA_EXTENSIONS.S3_FILES_ADAPTER", PROJECT_VERSION, previousVersion.getExtensionId());
verifyVirtualTableContainsData(virtualTable);
}

Expand All @@ -239,10 +239,11 @@ private PreviousExtensionVersion createPreviousVersion() {
.build();
}

private void assertInstalledVersion(final String expectedName, final String expectedVersion) {
private void assertInstalledVersion(final String expectedName, final String expectedVersion,
final String expectedId) {
final List<InstallationsResponseInstallation> installations = setup.client().getInstallations();
final InstallationsResponseInstallation expectedInstallation = new InstallationsResponseInstallation()
.name(expectedName).version(expectedVersion);
.name(expectedName).version(expectedVersion).id(expectedId);
// The extension 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)),
Expand Down

0 comments on commit 1c6697f

Please sign in to comment.