### Question:
DataSourceInformationRepository { public void addDataSourceInformation(DataSourceInformation dataSourceInformation) { if (dataSourceInformation == null) { throw new SynapseCommonsException("DataSource information is null", log); } SecretInformation secretInformation = dataSourceInformation.getSecretInformation(); if (secretInformation != null) { secretInformation.setGlobalSecretResolver(secretResolver); } dataSourceInformationMap.put(dataSourceInformation.getAlias(), dataSourceInformation); if (assertListerNotNull()) { listener.addDataSourceInformation(dataSourceInformation); } }  void configure(Properties configurationProperties); void addDataSourceInformation(DataSourceInformation dataSourceInformation); DataSourceInformation getDataSourceInformation(String name); DataSourceInformation removeDataSourceInformation(String name); Iterator<DataSourceInformation> getAllDataSourceInformation(); void setRepositoryListener(DataSourceInformationRepositoryListener listener); void removeRepositoryListener(); DataSourceInformationRepositoryListener getRepositoryListener();  }### Answer:
@Test public void testAddDataSourceInformationNull() { thrown.expectMessage("DataSource information is null"); thrown.expect(SynapseCommonsException.class); repository.addDataSourceInformation(null); }
@Test public void testAddDataSourceInformation() throws IllegalAccessException { repository.addDataSourceInformation(information); Assert.assertEquals("datasource information should be added to the map", ((Map<String, DataSourceInformation>) dataSourceInformationMap.get(repository)).size(), 1); DataSourceInformation tempInfo = repository.getDataSourceInformation(ALIAS); Assert.assertEquals("receives datasource info should be same as the saved", information, tempInfo); tempInfo = repository.removeDataSourceInformation(ALIAS); Assert.assertEquals("datasource info should be removed", information, tempInfo); }