### Question:
XmlaConnectionResourceConverter extends ResourceConverterImpl<XMLAConnection, ClientXmlaConnection> { @Override protected XMLAConnection resourceSpecificFieldsToServer(ClientXmlaConnection clientObject, XMLAConnection resultToUpdate, List<Exception> exceptions, ToServerConversionOptions options) throws IllegalParameterValueException { resultToUpdate.setURI(clientObject.getUrl()); resultToUpdate.setCatalog(clientObject.getCatalog()); resultToUpdate.setDataSource(clientObject.getDataSource()); final String password = clientObject.getPassword(); if (password != null) { resultToUpdate.setPassword(password); } resultToUpdate.setUsername(clientObject.getUsername()); return resultToUpdate; }    }### Answer:
@Test public void resourceSpecificFieldsToServer() throws Exception { final String expectedUrl = "testUri"; final String expectedDataSource = "testDataSource"; final String expectedCatalog = "testCatalog"; final String expectedUsername = "testUsername"; final String expectedPassword = "testPassword"; ClientXmlaConnection clientObject = new ClientXmlaConnection(); XMLAConnection serverObject = new XMLAConnectionImpl(); clientObject.setUrl(expectedUrl); clientObject.setCatalog(expectedCatalog); clientObject.setDataSource(expectedDataSource); clientObject.setPassword(expectedPassword); clientObject.setUsername(expectedUsername); final XMLAConnection result = converter.resourceSpecificFieldsToServer(clientObject, serverObject, new ArrayList<Exception>(), null); assertSame(result, serverObject); assertEquals(result.getURI(), expectedUrl); assertEquals(result.getCatalog(), expectedCatalog); assertEquals(result.getDataSource(), expectedDataSource); assertEquals(result.getPassword(), expectedPassword); assertEquals(result.getUsername(), expectedUsername); }
@Test public void resourceSpecificFieldsToServer_nullPasswordDoesNotChange() throws IllegalParameterValueException { final String expectedPassword = "testPassword"; ClientXmlaConnection clientObject = new ClientXmlaConnection(); XMLAConnection serverObject = new XMLAConnectionImpl(); serverObject.setPassword(expectedPassword); final XMLAConnection result = converter.resourceSpecificFieldsToServer(clientObject, serverObject, new ArrayList<Exception>(), null); assertEquals(result.getPassword(), expectedPassword); }