From 727acc96b8ca7b407b0394e7d5d9467a074822e0 Mon Sep 17 00:00:00 2001 From: Tomas Langer Date: Mon, 22 Jan 2024 21:08:21 +0100 Subject: [PATCH] Use a single version of testcontainers (#8279) Fix version of mysql for vault tests Signed-off-by: Tomas Langer --- tests/integration/pom.xml | 1 - .../examples/integrations/vault/hcp/VaultTest.java | 14 ++++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/tests/integration/pom.xml b/tests/integration/pom.xml index 9ed395b13ec..31377fd7775 100644 --- a/tests/integration/pom.xml +++ b/tests/integration/pom.xml @@ -33,7 +33,6 @@ Helidon Tests Integration - 1.17.5 2.3.0 diff --git a/tests/integration/vault/src/test/java/io/helidon/examples/integrations/vault/hcp/VaultTest.java b/tests/integration/vault/src/test/java/io/helidon/examples/integrations/vault/hcp/VaultTest.java index 2628a5cb76d..98adfcfe3bb 100644 --- a/tests/integration/vault/src/test/java/io/helidon/examples/integrations/vault/hcp/VaultTest.java +++ b/tests/integration/vault/src/test/java/io/helidon/examples/integrations/vault/hcp/VaultTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022, 2023 Oracle and/or its affiliates. + * Copyright (c) 2022, 2024 Oracle and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -94,14 +94,16 @@ class VaultTest { private static final String APPROLE_POLICY_NAME = "approle_policy"; private static final String APPROLE_ROLE_NAME = "approle_role"; private static final Duration TIMEOUT = Duration.ofSeconds(5); - private static final DockerImageName MYSQL_IMAGE = DockerImageName.parse("mysql:8"); + private static final DockerImageName MYSQL_IMAGE = DockerImageName.parse("mysql:8.0.36"); private static final DockerImageName HCP_VAULT_IMAGE = DockerImageName.parse("vault:1.11.3"); private static final Network NETWORK = Network.newNetwork(); + private static final String MYSQL_USER = "root"; + private static final String MYSQL_PASSWORD = "changeit"; @Container private static final MySQLContainer MY_SQL_CONTAINER = new MySQLContainer<>(MYSQL_IMAGE) - .withUsername("root") - .withPassword("root") + .withUsername(MYSQL_USER) + .withPassword(MYSQL_PASSWORD) .withNetworkAliases("mysql") .withDatabaseName("pokemon") .withNetwork(NETWORK); @@ -278,8 +280,8 @@ void testDatabase() throws SQLException { DbConfigure.Response dbConfigResponse = database .configure(MySqlConfigureRequest.builder(connectionTemplate) .name("mysql") - .username("root") - .password("root") + .username(MYSQL_USER) + .password(MYSQL_PASSWORD) .maxOpenConnections(5) .maxConnectionLifetime(Duration.ofMinutes(1)) .addAllowedRole("readonly"));