diff --git a/src/test/java/com/exasol/clusterlogs/MappedClusterLogsIT.java b/src/test/java/com/exasol/clusterlogs/MappedClusterLogsIT.java index a8a7216d..081b9642 100644 --- a/src/test/java/com/exasol/clusterlogs/MappedClusterLogsIT.java +++ b/src/test/java/com/exasol/clusterlogs/MappedClusterLogsIT.java @@ -3,15 +3,14 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.equalTo; -import java.io.File; -import java.io.IOException; +import java.io.*; +import java.nio.file.Files; import java.nio.file.Path; import org.junit.jupiter.api.Tag; import org.junit.jupiter.api.Test; import org.testcontainers.junit.jupiter.Container; import org.testcontainers.junit.jupiter.Testcontainers; -import org.testcontainers.shaded.com.google.common.io.Files; import com.exasol.containers.ExasolContainer; @@ -21,13 +20,21 @@ class MappedClusterLogsIT { private static final Path TEMP_DIR = createTempDir(); private static Path createTempDir() { - final File tempDir = Files.createTempDir(); - tempDir.deleteOnExit(); - return tempDir.toPath(); + final Path tempDir = createTempPath(); + tempDir.toFile().deleteOnExit(); + return tempDir; + } + + private static Path createTempPath() { + try { + return Files.createTempDirectory("MappedClusterLogsIT"); + } catch (final IOException exception) { + throw new UncheckedIOException(exception); + } } @Container - private static final ExasolContainer> CONTAINER = new ExasolContainer<>() // + private static final ExasolContainer> CONTAINER = new ExasolContainer<>("8.23.0") // .withClusterLogsPath(TEMP_DIR) // .withRequiredServices(); @@ -37,4 +44,4 @@ void testMapClusterLogs() throws InterruptedException, IOException { final File syslogFile = TEMP_DIR.resolve("syslog").toFile(); assertThat("File " + syslogFile + " exists", syslogFile.exists(), equalTo(true)); } -} \ No newline at end of file +} diff --git a/src/test/java/com/exasol/containers/tls/CertificateProviderIT.java b/src/test/java/com/exasol/containers/tls/CertificateProviderIT.java index bd58a14c..1b2b4e63 100644 --- a/src/test/java/com/exasol/containers/tls/CertificateProviderIT.java +++ b/src/test/java/com/exasol/containers/tls/CertificateProviderIT.java @@ -28,8 +28,8 @@ void testGetCertificate() { final Optional optionalCertificate = CONTAINER.getTlsCertificate(); final var certificate = optionalCertificate.get(); assertAll(() -> assertThat(certificate, notNullValue()), - () -> assertThat(certificate.getIssuerDN().getName(), equalTo("CN=exacluster.local")), - () -> assertThat(certificate.getSubjectDN().getName(), + () -> assertThat(certificate.getIssuerX500Principal().getName(), equalTo("CN=exacluster.local")), + () -> assertThat(certificate.getSubjectX500Principal().getName(), either(equalTo("CN=*.exacluster.local")).or(equalTo("CN=srv.exacluster.local"))), () -> assertThat(certificate.getNotBefore(), lessThan(now)), () -> assertThat(certificate.getNotAfter(), greaterThan(now))); diff --git a/src/test/java/com/exasol/containers/tls/CertificateProviderTest.java b/src/test/java/com/exasol/containers/tls/CertificateProviderTest.java index 893171d9..2d16e7f5 100644 --- a/src/test/java/com/exasol/containers/tls/CertificateProviderTest.java +++ b/src/test/java/com/exasol/containers/tls/CertificateProviderTest.java @@ -46,7 +46,7 @@ void testGetCertificateSucceeds() throws ExasolContainerException { final Optional certificate = this.certificateProvider.getCertificate(); assertThat(certificate.isPresent(), is(true)); assertThat(certificate.get(), notNullValue()); - assertThat(certificate.get().getIssuerDN().getName(), equalTo("CN=exacluster.local")); + assertThat(certificate.get().getIssuerX500Principal().getName(), equalTo("CN=exacluster.local")); } private void simulateTlsCert(final String certContent) throws ExasolContainerException {