### Question:
PGDataSource { public static Map<String, String> extractDbInfo(String databaseURL) { Map<String, String> results = new HashMap<>(); URI dbUri; try { dbUri = new URI(databaseURL); } catch (URISyntaxException e) { throw new IllegalArgumentException("", e); } if (dbUri.getUserInfo() != null) { final String username = dbUri.getUserInfo().split(":")[0]; final String password = dbUri.getUserInfo().split(":")[1]; results.put("username", username); results.put("password", password); results.put("host", dbUri.getHost()); results.put("port", Integer.toString(dbUri.getPort())); String path = dbUri.getPath(); if (path.startsWith("/")) { path = path.substring(1, path.length()); } results.put("database", path); } return results; }  static boolean isSetPGDataSource(); static DataSource getDataSource(); static void setDataSource(DataSource datasource); static void setDataSource(DataSource datasource, boolean isPg); static Map<String, String> extractDbInfo(String databaseURL); static boolean isPostgres; }### Answer:
@Test public void insertTest() { String databaseURL = "postgres: Map<String, String> results = PGDataSource.extractDbInfo(databaseURL); Assert.assertEquals("cstl", results.get("username")); Assert.assertEquals("admin", results.get("password")); Assert.assertEquals("localhost", results.get("host")); Assert.assertEquals("5432", results.get("port")); Assert.assertEquals("cstl-test", results.get("database")); }