@Test public void testSetStatementDecoratorClassWithInvalidClass() { Properties properties = new Properties(); properties.put("connection.native.decorator.class", NonOverridingProviderClass.class.getName()); assertThatExceptionOfType(ConfigurationException.class).isThrownBy(() -> ConnectionProperties.from(properties)); }
public static ConnectionProperties from(Properties properties) throws ConfigurationException { Class<? extends NativeConnectionProvider> nativeConnectionProviderClass = getClassOfType(properties, CONFIG_CONNECTION_NATIVE_CLASS, DEFAULT_CONNECTION_NATIVE_CLASS, NativeConnectionProvider.class); Class<? extends JmxConnectionProvider> jmxConnectionProviderClass = getClassOfType(properties, CONFIG_CONNECTION_JMX_CLASS, DEFAULT_STATEMENT_DECORATOR_CLASS, JmxConnectionProvider.class); Class<? extends StatementDecorator> statementDecoratorClass = getClassOfType(properties, CONFIG_STATEMENT_DECORATOR_CLASS, DEFAULT_CONNECTION_JMX_CLASS, StatementDecorator.class); return new ConnectionProperties(nativeConnectionProviderClass, jmxConnectionProviderClass, statementDecoratorClass); }
ConnectionProperties { public static ConnectionProperties from(Properties properties) throws ConfigurationException { Class<? extends NativeConnectionProvider> nativeConnectionProviderClass = getClassOfType(properties, CONFIG_CONNECTION_NATIVE_CLASS, DEFAULT_CONNECTION_NATIVE_CLASS, NativeConnectionProvider.class); Class<? extends JmxConnectionProvider> jmxConnectionProviderClass = getClassOfType(properties, CONFIG_CONNECTION_JMX_CLASS, DEFAULT_STATEMENT_DECORATOR_CLASS, JmxConnectionProvider.class); Class<? extends StatementDecorator> statementDecoratorClass = getClassOfType(properties, CONFIG_STATEMENT_DECORATOR_CLASS, DEFAULT_CONNECTION_JMX_CLASS, StatementDecorator.class); return new ConnectionProperties(nativeConnectionProviderClass, jmxConnectionProviderClass, statementDecoratorClass); } }
ConnectionProperties { public static ConnectionProperties from(Properties properties) throws ConfigurationException { Class<? extends NativeConnectionProvider> nativeConnectionProviderClass = getClassOfType(properties, CONFIG_CONNECTION_NATIVE_CLASS, DEFAULT_CONNECTION_NATIVE_CLASS, NativeConnectionProvider.class); Class<? extends JmxConnectionProvider> jmxConnectionProviderClass = getClassOfType(properties, CONFIG_CONNECTION_JMX_CLASS, DEFAULT_STATEMENT_DECORATOR_CLASS, JmxConnectionProvider.class); Class<? extends StatementDecorator> statementDecoratorClass = getClassOfType(properties, CONFIG_STATEMENT_DECORATOR_CLASS, DEFAULT_CONNECTION_JMX_CLASS, StatementDecorator.class); return new ConnectionProperties(nativeConnectionProviderClass, jmxConnectionProviderClass, statementDecoratorClass); } private  ConnectionProperties(Class<? extends NativeConnectionProvider> nativeConnectionProviderClass,
                                 Class<? extends JmxConnectionProvider> jmxConnectionProviderClass,
                                 Class<? extends StatementDecorator> statementDecoratorClass); }
ConnectionProperties { public static ConnectionProperties from(Properties properties) throws ConfigurationException { Class<? extends NativeConnectionProvider> nativeConnectionProviderClass = getClassOfType(properties, CONFIG_CONNECTION_NATIVE_CLASS, DEFAULT_CONNECTION_NATIVE_CLASS, NativeConnectionProvider.class); Class<? extends JmxConnectionProvider> jmxConnectionProviderClass = getClassOfType(properties, CONFIG_CONNECTION_JMX_CLASS, DEFAULT_STATEMENT_DECORATOR_CLASS, JmxConnectionProvider.class); Class<? extends StatementDecorator> statementDecoratorClass = getClassOfType(properties, CONFIG_STATEMENT_DECORATOR_CLASS, DEFAULT_CONNECTION_JMX_CLASS, StatementDecorator.class); return new ConnectionProperties(nativeConnectionProviderClass, jmxConnectionProviderClass, statementDecoratorClass); } private  ConnectionProperties(Class<? extends NativeConnectionProvider> nativeConnectionProviderClass,
                                 Class<? extends JmxConnectionProvider> jmxConnectionProviderClass,
                                 Class<? extends StatementDecorator> statementDecoratorClass); Class<? extends NativeConnectionProvider> getNativeConnectionProviderClass(); Class<? extends JmxConnectionProvider> getJmxConnectionProviderClass(); Class<? extends StatementDecorator> getStatementDecoratorClass(); @Override String toString(); static ConnectionProperties from(Properties properties); }
ConnectionProperties { public static ConnectionProperties from(Properties properties) throws ConfigurationException { Class<? extends NativeConnectionProvider> nativeConnectionProviderClass = getClassOfType(properties, CONFIG_CONNECTION_NATIVE_CLASS, DEFAULT_CONNECTION_NATIVE_CLASS, NativeConnectionProvider.class); Class<? extends JmxConnectionProvider> jmxConnectionProviderClass = getClassOfType(properties, CONFIG_CONNECTION_JMX_CLASS, DEFAULT_STATEMENT_DECORATOR_CLASS, JmxConnectionProvider.class); Class<? extends StatementDecorator> statementDecoratorClass = getClassOfType(properties, CONFIG_STATEMENT_DECORATOR_CLASS, DEFAULT_CONNECTION_JMX_CLASS, StatementDecorator.class); return new ConnectionProperties(nativeConnectionProviderClass, jmxConnectionProviderClass, statementDecoratorClass); } private  ConnectionProperties(Class<? extends NativeConnectionProvider> nativeConnectionProviderClass,
                                 Class<? extends JmxConnectionProvider> jmxConnectionProviderClass,
                                 Class<? extends StatementDecorator> statementDecoratorClass); Class<? extends NativeConnectionProvider> getNativeConnectionProviderClass(); Class<? extends JmxConnectionProvider> getJmxConnectionProviderClass(); Class<? extends StatementDecorator> getStatementDecoratorClass(); @Override String toString(); static ConnectionProperties from(Properties properties);  }