### Question:
PipelineCodeMapper { public XContentBuilder pipelineCodeToDocument(final Pipeline pipeline, final String pipelineVersion, final String path, final byte[] fileContent, final PermissionsContainer permissions) { try (XContentBuilder jsonBuilder = XContentFactory.jsonBuilder()) { jsonBuilder .startObject() .field(DOC_TYPE_FIELD, SearchDocumentType.PIPELINE_CODE.name()) .field("pipelineId", pipeline.getId()) .field("pipelineName", pipeline.getName()) .field("pipelineVersion", pipelineVersion) .field("path", path) .field("content", buildDocContent(fileContent)); jsonBuilder.array("allowed_users", permissions.getAllowedUsers().toArray()); jsonBuilder.array("denied_users", permissions.getDeniedUsers().toArray()); jsonBuilder.array("allowed_groups", permissions.getAllowedGroups().toArray()); jsonBuilder.array("denied_groups", permissions.getDeniedGroups().toArray()); jsonBuilder.endObject(); return jsonBuilder; } catch (IOException e) { throw new IllegalArgumentException("An error occurred while creating document: ", e); } }  XContentBuilder pipelineCodeToDocument(final Pipeline pipeline,
                                                  final String pipelineVersion,
                                                  final String path,
                                                  final byte[] fileContent,
                                                  final PermissionsContainer permissions);  }### Answer:
@Test void shouldMapPipelineCode() throws IOException { PipelineCodeMapper mapper = new PipelineCodeMapper(); Pipeline pipeline = new Pipeline(); pipeline.setId(1L); pipeline.setName(TEST_NAME); XContentBuilder contentBuilder = mapper.pipelineCodeToDocument(pipeline, TEST_VERSION, TEST_PATH, TEST_VALUE_BYTE, PERMISSIONS_CONTAINER); verifyPipelineCode(pipeline, TEST_VERSION, TEST_PATH, TEST_VALUE, contentBuilder); verifyPermissions(PERMISSIONS_CONTAINER, contentBuilder); }