### Question:
BinaryDataResourceConverter implements ResourceConverter<Resource, ClientFile> { @Override public Resource toServer(ClientFile clientObject, ToServerConversionOptions options) throws IllegalParameterValueException, MandatoryParameterNotFoundException { return toServer(clientObject, fileResourceTypes.contains(clientObject.getType().toString()) ? new FileResourceImpl() : new ContentResourceImpl(), options); }  @Override Class<ClientFile> getClientTypeClass(); @Override ClientFile toClient(Resource serverObject, ToClientConversionOptions options); @Override String getClientResourceType(); @Override Resource toServer(ClientFile clientObject, ToServerConversionOptions options); @Override Resource toServer(ClientFile clientObject, Resource resultToUpdate, ToServerConversionOptions options); @Override String getServerResourceType();  }### Answer:
@Test public void testToServer_file() throws Exception { file.setType(ClientFile.FileType.prop); converter.toServer(file, new FileResourceImpl(), null); verify(fileResourceConverter).toServer(eq(file), nullable(FileResource.class), nullable(ToServerConversionOptions.class)); }
@Test public void testToServer_file_no_update() throws Exception { file.setType(ClientFile.FileType.prop); when(fileResourceTypes.contains(any())).thenReturn(true); converter.toServer(file,null); verify(fileResourceConverter).toServer(eq(file), nullable(FileResource.class), nullable(ToServerConversionOptions.class)); }
@Test public void testToServer_content() throws Exception { file.setType(ClientFile.FileType.css); converter.toServer(file, new ContentResourceImpl(), null); verify(contentResourceConverter).toServer(eq(file), nullable(ContentResource.class), nullable(ToServerConversionOptions.class)); }
@Test public void testToServer_content_no_update() throws Exception { file.setType(ClientFile.FileType.css); when(fileResourceTypes.contains(any())).thenReturn(false); converter.toServer(file, null); verify(contentResourceConverter).toServer(eq(file), nullable(ContentResource.class), nullable(ToServerConversionOptions.class)); }