### Question:
DataSourceProxy extends AbstractDataSourceProxy implements Resource { @Override public String getResourceId() { if (JdbcConstants.POSTGRESQL.equals(dbType)) { return getPGResourceId(); } else if (JdbcConstants.ORACLE.equals(dbType) && userName != null) { return getDefaultResourceId() + "/" + userName; } else { return getDefaultResourceId(); } } DataSourceProxy(DataSource targetDataSource);  DataSourceProxy(DataSource targetDataSource, String resourceGroupId); Connection getPlainConnection(); String getDbType(); @Override ConnectionProxy getConnection(); @Override ConnectionProxy getConnection(String username, String password); @Override String getResourceGroupId(); @Override String getResourceId(); @Override BranchType getBranchType();  }### Answer:
@Test public void getResourceIdTest() throws SQLException, NoSuchFieldException, IllegalAccessException { MockDriver mockDriver = new MockDriver(); String username = "username"; DruidDataSource dataSource = new DruidDataSource(); dataSource.setUrl("jdbc:mock:xxx"); dataSource.setDriver(mockDriver); dataSource.setUsername(username); dataSource.setPassword("password"); DataSourceProxy proxy = new DataSourceProxy(dataSource); Field dbTypeField = proxy.getClass().getDeclaredField("dbType"); dbTypeField.setAccessible(true); dbTypeField.set(proxy, io.seata.sqlparser.util.JdbcConstants.ORACLE); String userName = dataSource.getConnection().getMetaData().getUserName(); Assertions.assertEquals(userName, username); Field userNameField = proxy.getClass().getDeclaredField("userName"); userNameField.setAccessible(true); userNameField.set(proxy, username); Assertions.assertEquals(proxy.getResourceId(), "jdbc:mock:xxx/username"); dbTypeField.set(proxy, io.seata.sqlparser.util.JdbcConstants.MYSQL); Assertions.assertEquals(proxy.getResourceId(), "jdbc:mock:xxx"); }