|
|
@ -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");
|
|
|
|