### Question:
MondrianConnectionAttachmentsProcessor implements AttachmentsProcessor<MondrianConnection> { @Override public MondrianConnection processAttachments(MondrianConnection serverObject, Map<String, InputStream> parts) throws MandatoryParameterNotFoundException, IllegalParameterValueException { setDataToFileResourceWithValidation(parts.get(ResourceMultipartConstants.SCHEMA_PART_NAME), serverObject.getSchema(), ResourceMultipartConstants.SCHEMA_PART_NAME); return serverObject; }  @Override MondrianConnection processAttachments(MondrianConnection serverObject, Map<String, InputStream> parts);  }### Answer:
@Test public void processAttachments_withSchemaPart_setData() throws IllegalParameterValueException, MandatoryParameterNotFoundException { final MondrianConnectionImpl serverObject = new MondrianConnectionImpl(); serverObject.setSchemaReference("/test/reference"); final FileResourceImpl localResource = new FileResourceImpl(); serverObject.getSchema().setLocalResource(localResource); final Map<String, InputStream> parts = new HashMap<String, InputStream>(); byte[] expectedByteArray = new byte[]{1,2,3}; parts.put("schema", new ByteArrayInputStream(expectedByteArray)); final Resource result = processor.processAttachments(serverObject, parts); assertTrue(result instanceof MondrianConnection); MondrianConnection resultConnection = (MondrianConnection) result; assertNotNull(resultConnection.getSchema()); assertTrue(resultConnection.getSchema().getLocalResource() instanceof FileResource); assertEquals(((FileResource) resultConnection.getSchema().getLocalResource()).getData(), expectedByteArray); }