final Optional<String> testEnv = envsForTls.getKeystorePath();
// then
- assertThat(testEnv.isPresent()).isTrue();
- assertThat(testEnv.get()).isEqualTo(TEST_ENV);
+ assertThat(testEnv)
+ .isPresent()
+ .contains(TEST_ENV);
}
@Test
- public void shouldReportThatSystemEnvKeyStorePathVariableIsNotPresentWhenItWasNotDefined() {
+ void shouldReportThatSystemEnvKeyStorePathVariableIsNotPresentWhenItWasNotDefined() {
// when
final Optional<String> testEnv = envsForTls.getKeystorePath();
// then
- assertThat(testEnv.isPresent()).isFalse();
+ assertThat(testEnv).isNotPresent();
}
@Test
final Optional<String> testEnv = envsForTls.getKeystorePassword();
// then
- assertThat(testEnv.isPresent()).isTrue();
- assertThat(testEnv.get()).isEqualTo(TEST_ENV);
+ assertThat(testEnv)
+ .isPresent()
+ .contains(TEST_ENV);
}
@Test
- public void shouldReportThatSystemEnvKeyStorePasswordVariableIsNotPresentWhenItWasNotDefined() {
+ void shouldReportThatSystemEnvKeyStorePasswordVariableIsNotPresentWhenItWasNotDefined() {
// when
final Optional<String> testEnv = envsForTls.getKeystorePassword();
// then
- assertThat(testEnv.isPresent()).isFalse();
+ assertThat(testEnv).isNotPresent();
}
@Test
final Optional<String> testEnv = envsForTls.getTruststorePath();
// then
- assertThat(testEnv.isPresent()).isTrue();
- assertThat(testEnv.get()).isEqualTo(TEST_ENV);
+ assertThat(testEnv)
+ .isPresent()
+ .contains(TEST_ENV);
}
@Test
- public void shouldReportThatSystemEnvTrustStorePathVariableIsNotPresentWhenItWasNotDefined() {
+ void shouldReportThatSystemEnvTrustStorePathVariableIsNotPresentWhenItWasNotDefined() {
// when
final Optional<String> testEnv = envsForTls.getTruststorePath();
// then
- assertThat(testEnv.isPresent()).isFalse();
+ assertThat(testEnv).isNotPresent();
}
@Test
final Optional<String> testEnv = envsForTls.getTruststorePassword();
// then
- assertThat(testEnv.isPresent()).isTrue();
- assertThat(testEnv.get()).isEqualTo(TEST_ENV);
+ assertThat(testEnv)
+ .isPresent()
+ .contains(TEST_ENV);
}
@Test
- public void shouldReportThatSystemEnvTrustStorePasswordVariableIsNotPresentWhenItWasNotDefined() {
+ void shouldReportThatSystemEnvTrustStorePasswordVariableIsNotPresentWhenItWasNotDefined() {
// when
final Optional<String> testEnv = envsForTls.getTruststorePassword();
// then
- assertThat(testEnv.isPresent()).isFalse();
+ assertThat(testEnv).isNotPresent();
}
}