|
|
@ -34,7 +34,7 @@ class OracleEnvironmentTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
void getUsernameWhenHasAppUser() {
|
|
|
|
void getUsernameWhenHasAppUser() {
|
|
|
|
OracleEnvironment environment = new OracleEnvironment(Map.of("APP_USER", "alice", "APP_PASSWORD", "secret"));
|
|
|
|
OracleEnvironment environment = new OracleEnvironment(Map.of("APP_USER", "alice", "APP_USER_PASSWORD", "secret"));
|
|
|
|
assertThat(environment.getUsername()).isEqualTo("alice");
|
|
|
|
assertThat(environment.getUsername()).isEqualTo("alice");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -46,7 +46,7 @@ class OracleEnvironmentTests {
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
void getPasswordWhenHasAppPassword() {
|
|
|
|
void getPasswordWhenHasAppPassword() {
|
|
|
|
OracleEnvironment environment = new OracleEnvironment(Map.of("APP_USER", "alice", "APP_PASSWORD", "secret"));
|
|
|
|
OracleEnvironment environment = new OracleEnvironment(Map.of("APP_USER", "alice", "APP_USER_PASSWORD", "secret"));
|
|
|
|
assertThat(environment.getPassword()).isEqualTo("secret");
|
|
|
|
assertThat(environment.getPassword()).isEqualTo("secret");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -59,14 +59,14 @@ class OracleEnvironmentTests {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
void createWhenRandomPasswordAndAppPasswordDoesNotThrow() {
|
|
|
|
void createWhenRandomPasswordAndAppPasswordDoesNotThrow() {
|
|
|
|
assertThatNoException().isThrownBy(() -> new OracleEnvironment(
|
|
|
|
assertThatNoException().isThrownBy(() -> new OracleEnvironment(
|
|
|
|
Map.of("APP_USER", "alice", "APP_PASSWORD", "secret", "ORACLE_RANDOM_PASSWORD", "true")));
|
|
|
|
Map.of("APP_USER", "alice", "APP_USER_PASSWORD", "secret", "ORACLE_RANDOM_PASSWORD", "true")));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
void createWhenRandomPasswordThrowsException() {
|
|
|
|
void createWhenRandomPasswordThrowsException() {
|
|
|
|
assertThatIllegalStateException()
|
|
|
|
assertThatIllegalStateException()
|
|
|
|
.isThrownBy(() -> new OracleEnvironment(Map.of("ORACLE_RANDOM_PASSWORD", "true")))
|
|
|
|
.isThrownBy(() -> new OracleEnvironment(Map.of("ORACLE_RANDOM_PASSWORD", "true")))
|
|
|
|
.withMessage("ORACLE_RANDOM_PASSWORD is not supported without APP_USER and APP_PASSWORD");
|
|
|
|
.withMessage("ORACLE_RANDOM_PASSWORD is not supported without APP_USER and APP_USER_PASSWORD");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
@ -78,7 +78,7 @@ class OracleEnvironmentTests {
|
|
|
|
@Test
|
|
|
|
@Test
|
|
|
|
void createWhenAppUserAndEmptyAppPasswordThrowsException() {
|
|
|
|
void createWhenAppUserAndEmptyAppPasswordThrowsException() {
|
|
|
|
assertThatIllegalStateException()
|
|
|
|
assertThatIllegalStateException()
|
|
|
|
.isThrownBy(() -> new OracleEnvironment(Map.of("APP_USER", "alice", "APP_PASSWORD", "")))
|
|
|
|
.isThrownBy(() -> new OracleEnvironment(Map.of("APP_USER", "alice", "APP_USER_PASSWORD", "")))
|
|
|
|
.withMessage("No Oracle app password found");
|
|
|
|
.withMessage("No Oracle app password found");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|