@Test
    @SuppressWarnings("JdkObsolete")
    void verifyProxySource() throws Throwable {
        val ds = JpaBeans.newDataSource("org.hsqldb.jdbcDriver", "sa", StringUtils.EMPTY, "jdbc:hsqldb:mem:cas");
        val environment = new Hashtable<>();
        environment.put("java:comp/env/jdbc/MyDS", ds);
        val ctx = new InitialDirContext(environment);
        val props = new JpaServiceRegistryProperties();
        props.setDataSourceName("java:comp/env/jdbc/MyDS");
        assertNotNull(JpaBeans.newDataSource(props));

        props.setDataSourceName("bad-name");
        assertNotNull(JpaBeans.newDataSource(props));
        ctx.close();
    }
This is {@link DataSourceProxyTests}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-jpa-util/src/test/java/org/apereo/cas/configuration/support/DataSourceProxyTests.java