OracleConnectionConfig extends ConnectionConfig { public abstract Optional<ServiceNameConfiguration> serviceNameConfiguration();  abstract String getHost(); abstract int getPort(); @Override @Value.Default String getUrl(); @Override @Value.Derived @JsonIgnore Optional<String> namespace(); @Override @Value.Default String getDriverClass(); @Override @Value.Default String getTestQuery(); abstract Optional<String> getSid(); abstract Optional<ServiceNameConfiguration> serviceNameConfiguration(); abstract Optional<String> getServerDn(); @Value.Default boolean getMatchServerDn(); @Value.Default boolean getTwoWaySsl(); @Value.Default Map<String, String> getConnectionParameters(); @Value.Default ConnectionProtocol getProtocol(); abstract Optional<String> getKeystorePassword(); abstract Optional<String> getKeystorePath(); abstract Optional<String> getTruststorePassword(); abstract Optional<String> getTruststorePath(); @Override @Value.Default @Value.Auxiliary Properties getHikariProperties(); @Override @Value.Derived DBType getDbType(); @Override final String type(); static final String TYPE; }
@Test public void throwsIfBothSidAndServiceNameConfigurationAreSpecified() { OracleConnectionConfig.Builder builder = getBaseBuilder() .sid(SID) .serviceNameConfiguration(SERVICE_NAME_CONFIGURATION); assertThatThrownBy(builder::build) .isInstanceOf(SafeIllegalArgumentException.class) .hasMessageContaining("Exactly one of sid and serviceNameConfiguration should be provided."); }