### Question:
GenericJdbcDataSourceResourceConverter extends ResourceConverterImpl<JdbcDataSourceType, ClientJdbcDataSourceType> { @Override protected JdbcDataSourceType resourceSpecificFieldsToServer(ClientJdbcDataSourceType clientObject, JdbcDataSourceType resultToUpdate, List<Exception> exceptions, ToServerConversionOptions options) throws IllegalParameterValueException { resultToUpdate.setConnectionUrl(clientObject.getConnectionUrl()); resultToUpdate.setDriverClass(clientObject.getDriverClass()); resultToUpdate.setUsername(clientObject.getUsername()); resultToUpdate.setTimezone(clientObject.getTimezone()); if (clientObject.getPassword() != null) { resultToUpdate.setPassword(clientObject.getPassword()); } return resultToUpdate; }    }### Answer:
@Test public void resourceSpecificFieldsToServer() throws Exception { final ClientJdbcDataSource clientObject = new ClientJdbcDataSource(); clientObject.setConnectionUrl(expectedConnectionUrl); clientObject.setDriverClass(expectedDriverClass); clientObject.setPassword(expectedPassword); clientObject.setUsername(expectedUsername); clientObject.setTimezone(expectedTimezone); final JdbcReportDataSource serverObject = new JdbcReportDataSourceImpl(); final JdbcReportDataSource result = converter.resourceSpecificFieldsToServer(clientObject, serverObject, new ArrayList<Exception>(), null); assertSame(result, serverObject); assertEquals(result.getConnectionUrl(), expectedConnectionUrl); assertEquals(result.getDriverClass(), expectedDriverClass); assertEquals(result.getPassword(), expectedPassword); assertEquals(result.getUsername(), expectedUsername); assertEquals(result.getTimezone(), expectedTimezone); }
@Test public void resourceSpecificFieldsToServer_passwordNotSet() throws Exception { final ClientJdbcDataSource clientObject = new ClientJdbcDataSource(); clientObject.setConnectionUrl(expectedConnectionUrl); clientObject.setDriverClass(expectedDriverClass); clientObject.setPassword(null); clientObject.setUsername(expectedUsername); final JdbcReportDataSource serverObject = new JdbcReportDataSourceImpl(); serverObject.setPassword(expectedPassword); final JdbcReportDataSource result = converter.resourceSpecificFieldsToServer(clientObject, serverObject, new ArrayList<Exception>(), null); assertSame(result, serverObject); assertEquals(result.getConnectionUrl(), expectedConnectionUrl); assertEquals(result.getDriverClass(), expectedDriverClass); assertEquals(result.getPassword(), expectedPassword); assertEquals(result.getUsername(), expectedUsername); }