### Question:
AwsDataSourceResourceConverter extends GenericJdbcDataSourceResourceConverter<AwsReportDataSource, ClientAwsDataSource> { @Override protected ClientAwsDataSource resourceSpecificFieldsToClient(ClientAwsDataSource client, AwsReportDataSource serverObject, ToClientConversionOptions options) { final ClientAwsDataSource clientAwsDataSource = super.resourceSpecificFieldsToClient(client, serverObject, options); clientAwsDataSource.setRoleArn(serverObject.getRoleARN()); clientAwsDataSource.setAccessKey(serverObject.getAWSAccessKey()); clientAwsDataSource.setRegion(serverObject.getAWSRegion()); clientAwsDataSource.setDbInstanceIdentifier(serverObject.getDbInstanceIdentifier()); clientAwsDataSource.setDbName(serverObject.getDbName()); clientAwsDataSource.setDbService(serverObject.getDbService()); return clientAwsDataSource; }    }### Answer:
@Test public void resourceSpecificFieldsToClient(){ final String expectedAccessKey = "textAccessKey"; final String expectedSecretKey = "testSecretKey"; final String expectedRoleArn = "testRoleArn"; final String expectedRegion = "testRegion"; final String expectedDbName = "testDbName"; final String expectedDbInstanceIdentifier = "testDbInstanceIdentifier"; final String expectedDbService = "testDbService"; final String expectedDriverClass = "testDriverClass"; AwsReportDataSource serverObject = new AwsReportDataSourceImpl(); ClientAwsDataSource clientObject = new ClientAwsDataSource(); serverObject.setAWSAccessKey(expectedAccessKey); serverObject.setDbInstanceIdentifier(expectedDbInstanceIdentifier); serverObject.setDbName(expectedDbName); serverObject.setDbService(expectedDbService); serverObject.setAWSRegion(expectedRegion); serverObject.setRoleARN(expectedRoleArn); serverObject.setAWSSecretKey(expectedSecretKey); serverObject.setDriverClass(expectedDriverClass); final ClientAwsDataSource result = converter.resourceSpecificFieldsToClient(clientObject, serverObject, null); assertSame(result, clientObject); assertNull(result.getSecretKey()); assertEquals(result.getAccessKey(), expectedAccessKey); assertEquals(result.getRegion(), expectedRegion); assertEquals(result.getRoleArn(), expectedRoleArn); assertEquals(result.getDbInstanceIdentifier(), expectedDbInstanceIdentifier); assertEquals(result.getDbName(), expectedDbName); assertEquals(result.getDbService(), expectedDbService); assertEquals(result.getDriverClass(), expectedDriverClass); }
@Test public void resourceSpecificFieldsToClient_secretKeyRemainUnchangedIfNullInClientObject(){ final String expectedSecretKey = "testSecretKey"; AwsReportDataSource serverObject = new AwsReportDataSourceImpl(); serverObject.setAWSSecretKey(expectedSecretKey); ClientAwsDataSource clientObject = new ClientAwsDataSource(); final ClientAwsDataSource result = converter.resourceSpecificFieldsToClient(clientObject, serverObject, null); assertSame(result, clientObject); assertNull(clientObject.getSecretKey()); assertEquals(serverObject.getAWSSecretKey(), expectedSecretKey); }