    @Test
    public void testEncryptorWithExternalSecret() throws Exception {

        final DataSourceFactory dsf = expectTracked(c, context, DataSourceFactory.class, H2_DSF_FILTER);
        DataSource ds = expectDataSourceCreated(dsf);
        expectRegistration(ds);
        StringEncryptor encryptor = expectTracked(c, context, StringEncryptor.class, "(objectClass=org.jasypt.encryption.StringEncryptor)");
        expect(encryptor.decrypt("ciphertext")).andReturn("password");

        // Test config created
        c.replay();

        DataSourceConfigManager dsManager = new DataSourceConfigManager(context, new ExternalConfigLoader(context));

        Dictionary<String, String> properties = new Hashtable<String, String>();
        properties.put(DataSourceRegistration.JNDI_SERVICE_NAME, "test");
        properties.put(DataSourceFactory.OSGI_JDBC_DRIVER_CLASS, H2_DRIVER_CLASS);
        properties.put(DataSourceFactory.JDBC_DATABASE_NAME, "mydbname");
        String externalEncryptedValue = "FILE(" + ExternalConfigLoaderTest
            .createExternalSecret("ENC(ciphertext)") + ")";
        properties.put(DataSourceFactory.JDBC_PASSWORD, externalEncryptedValue);
        dsManager.updated(TESTPID, properties);
        c.verify();

        // the encrypted/external value is still encrypted/external
        assertEquals(externalEncryptedValue, properties.get(DataSourceFactory.JDBC_PASSWORD));
    }