Merge branch '3.1.x'

Closes gh-37624
pull/37626/head
Scott Frederick 1 year ago
commit 619a0f3b35

@ -30,6 +30,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
* @author Moritz Halbritter * @author Moritz Halbritter
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Phillip Webb * @author Phillip Webb
* @author Jinseong Hwang
*/ */
class MariaDbEnvironmentTests { class MariaDbEnvironmentTests {
@ -74,21 +75,21 @@ class MariaDbEnvironmentTests {
} }
@Test @Test
void getUsernameWhenHasMySqlUser() { void getUsernameWhenHasMysqlUser() {
MariaDbEnvironment environment = new MariaDbEnvironment( MariaDbEnvironment environment = new MariaDbEnvironment(
Map.of("MYSQL_USER", "myself", "MARIADB_PASSWORD", "secret", "MARIADB_DATABASE", "db")); Map.of("MYSQL_USER", "myself", "MARIADB_PASSWORD", "secret", "MARIADB_DATABASE", "db"));
assertThat(environment.getUsername()).isEqualTo("myself"); assertThat(environment.getUsername()).isEqualTo("myself");
} }
@Test @Test
void getUsernameWhenHasMariadbUserAndMySqlUser() { void getUsernameWhenHasMariadbUserAndMysqlUser() {
MariaDbEnvironment environment = new MariaDbEnvironment(Map.of("MARIADB_USER", "myself", "MYSQL_USER", "me", MariaDbEnvironment environment = new MariaDbEnvironment(Map.of("MARIADB_USER", "myself", "MYSQL_USER", "me",
"MARIADB_PASSWORD", "secret", "MARIADB_DATABASE", "db")); "MARIADB_PASSWORD", "secret", "MARIADB_DATABASE", "db"));
assertThat(environment.getUsername()).isEqualTo("myself"); assertThat(environment.getUsername()).isEqualTo("myself");
} }
@Test @Test
void getUsernameWhenHasNoMariadbUserOrMySqlUser() { void getUsernameWhenHasNoMariadbUserOrMysqlUser() {
MariaDbEnvironment environment = new MariaDbEnvironment( MariaDbEnvironment environment = new MariaDbEnvironment(
Map.of("MARIADB_PASSWORD", "secret", "MARIADB_DATABASE", "db")); Map.of("MARIADB_PASSWORD", "secret", "MARIADB_DATABASE", "db"));
assertThat(environment.getUsername()).isEqualTo("root"); assertThat(environment.getUsername()).isEqualTo("root");

@ -30,6 +30,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
* @author Moritz Halbritter * @author Moritz Halbritter
* @author Andy Wilkinson * @author Andy Wilkinson
* @author Phillip Webb * @author Phillip Webb
* @author Jinseong Hwang
*/ */
class MySqlEnvironmentTests { class MySqlEnvironmentTests {
@ -53,14 +54,14 @@ class MySqlEnvironmentTests {
} }
@Test @Test
void getUsernameWhenHasMySqlUser() { void getUsernameWhenHasMysqlUser() {
MySqlEnvironment environment = new MySqlEnvironment( MySqlEnvironment environment = new MySqlEnvironment(
Map.of("MYSQL_USER", "myself", "MYSQL_PASSWORD", "secret", "MYSQL_DATABASE", "db")); Map.of("MYSQL_USER", "myself", "MYSQL_PASSWORD", "secret", "MYSQL_DATABASE", "db"));
assertThat(environment.getUsername()).isEqualTo("myself"); assertThat(environment.getUsername()).isEqualTo("myself");
} }
@Test @Test
void getUsernameWhenHasNoMySqlUser() { void getUsernameWhenHasNoMysqlUser() {
MySqlEnvironment environment = new MySqlEnvironment(Map.of("MYSQL_PASSWORD", "secret", "MYSQL_DATABASE", "db")); MySqlEnvironment environment = new MySqlEnvironment(Map.of("MYSQL_PASSWORD", "secret", "MYSQL_DATABASE", "db"));
assertThat(environment.getUsername()).isEqualTo("root"); assertThat(environment.getUsername()).isEqualTo("root");
} }

@ -119,7 +119,7 @@ public final class DockerImageNames {
/** /**
* Return a {@link DockerImageName} suitable for running MariaDB. * Return a {@link DockerImageName} suitable for running MariaDB.
* @return a docker image name for running Mariadb * @return a docker image name for running MariaDB
*/ */
public static DockerImageName mariadb() { public static DockerImageName mariadb() {
return DockerImageName.parse("mariadb").withTag(MARIADB_VERSION); return DockerImageName.parse("mariadb").withTag(MARIADB_VERSION);

Loading…
Cancel
Save