### Question:
JNDIBasedDataSourceRepository implements DataSourceRepository { public void init(Properties jndiEnv) { initialized = true; if (jndiEnv == null || jndiEnv.isEmpty()) { if (log.isDebugEnabled()) { log.debug("Provided global JNDI environment properties is empty or null."); } return; } if (isValid(jndiEnv)) { jndiProperties = createJNDIEnvironment(jndiEnv, null); initialContext = createInitialContext(jndiProperties); } }  void init(Properties jndiEnv); void register(DataSourceInformation information); void unRegister(String name); DataSource lookUp(String dsName); void clear(); boolean isInitialized();  }### Answer:
@Test public void testInit() throws UnknownHostException, IllegalAccessException, NoSuchFieldException { final String key1 = "java.naming.provider.url"; final String key2 = "java.naming.factory.initial"; final String value2 = "com.sun.jndi.rmi.registry.RegistryContextFactory"; Assert.assertEquals("Asserting property 1 inserted by method", ((Properties) jndiProperties.get (jndiBasedDataSourceRepository)).getProperty(key1), url); Assert.assertEquals("Asserting property 2 inserted by method", ((Properties) jndiProperties.get (jndiBasedDataSourceRepository)).getProperty(key2), value2); }