### Question:
GenericMondrianConnectionResourceConverter extends  DataSourceHolderResourceConverter<MondrianConnectionServerSubType, MondrianConnectionClientSubType> { @Override protected MondrianConnectionServerSubType resourceSpecificFieldsToServer(MondrianConnectionClientSubType clientObject, MondrianConnectionServerSubType resultToUpdate, List<Exception> exceptions, ToServerConversionOptions options) throws IllegalParameterValueException, MandatoryParameterNotFoundException { resultToUpdate.setSchema(resourceReferenceConverterProvider.getConverterForType(ClientReferenceableFile.class) .addReferenceRestriction(new ResourceReferenceConverter.FileTypeRestriction(ClientFile.FileType.olapMondrianSchema)) .toServer(clientObject.getSchema(), resultToUpdate.getSchema(), options)); return resultToUpdate; }    }### Answer:
@Test public void resourceSpecificFieldsToServer() throws Exception { final ClientMondrianConnection clientObject = new ClientMondrianConnection(); final MondrianConnection serverObject = new MondrianConnectionImpl(); final String fileReferenceUri = "/schema/reference/uri"; final ResourceReference fileReference = new ResourceReference(fileReferenceUri); final ClientReference clientReference = new ClientReference(fileReferenceUri); final ToServerConversionOptions options = ToServerConversionOptions.getDefault(); when(fileResourceReferenceConverter.toServer(eq(clientReference), nullable(ResourceReference.class), nullable(ToServerConversionOptions.class))).thenReturn(fileReference); clientObject.setSchema(clientReference); final MondrianConnection result = converter.resourceSpecificFieldsToServer(clientObject, serverObject, new ArrayList<Exception>(), options); assertSame(result, serverObject); final ResourceReference resultReference = result.getSchema(); assertSame(resultReference, fileReference); verify(fileResourceReferenceConverter).addReferenceRestriction(restrictionArgumentCaptor.capture()); final List<ClientReferenceRestriction> restrictions = restrictionArgumentCaptor.getAllValues(); assertNotNull(restrictions); assertEquals(restrictions.size(), 1); final ClientReferenceRestriction restriction = restrictions.get(0); assertTrue(restriction instanceof ResourceReferenceConverter.FileTypeRestriction); final ClientFile fileToTest = new ClientFile(); fileToTest.setType(ClientFile.FileType.olapMondrianSchema); restriction.validateReference(fileToTest); }