### Question:
DefinitionsConverter { public Definitions toDefinitions() { Definitions definitions = bpmn2.createDefinitions(); DefinitionsPropertyWriter p = propertyWriterFactory.of(definitions); ProcessPropertyWriter pp = processConverter.convertProcess(); Node<Definition<BPMNDiagram>, ?> node = converterFactory.context.firstNode(); BPMNDiagram definition = node.getContent().getDefinition(); BaseDiagramSet diagramSet = definition.getDiagramSet(); p.setExporter("jBPM Process Modeler"); p.setExporterVersion("2.0"); p.setProcess(pp.getProcess()); p.setDiagram(pp.getBpmnDiagram()); p.setRelationship(pp.getRelationship()); p.setWSDLImports(diagramSet.getImports().getValue().getWSDLImports()); p.addAllRootElements(pp.getItemDefinitions()); p.addAllRootElements(pp.getRootElements()); p.addAllRootElements(pp.getInterfaces()); return definitions; } DefinitionsConverter(ConverterFactory converterFactory, PropertyWriterFactory propertyWriterFactory);  DefinitionsConverter(Graph graph); Definitions toDefinitions();  }### Answer:
@Test public void JBPM_7526_shouldSetExporter() { GraphNodeStoreImpl nodeStore = new GraphNodeStoreImpl(); NodeImpl x = new NodeImpl("x"); BPMNDiagramImpl diag = new BPMNDiagramImpl(); diag.setDiagramSet(new DiagramSet( new Name("x"), new Documentation("doc"), new Id("x"), new Package("org.jbpm"), new ProcessType(), new Version("1.0"), new AdHoc(false), new ProcessInstanceDescription("descr"), new Imports(), new Executable(true), new SLADueDate("") )); x.setContent(new ViewImpl<>(diag, Bounds.create())); nodeStore.add(x); ConverterFactory f = new ConverterFactory(new DefinitionsBuildingContext( new GraphImpl("x", nodeStore)), new PropertyWriterFactory()); DefinitionsConverter definitionsConverter = new DefinitionsConverter(f, new PropertyWriterFactory()); Definitions definitions = definitionsConverter.toDefinitions(); assertThat(definitions.getExporter()).isNotBlank(); assertThat(definitions.getExporterVersion()).isNotBlank(); }
@Test public void toDefinitions() { final String LOCATION = "Location"; final String NAMESPACE = "Namespace"; ImportsValue importsValue = new ImportsValue(); importsValue.addImport(new WSDLImport(LOCATION, NAMESPACE)); BPMNDiagramImpl diag = new BPMNDiagramImpl(); diag.setDiagramSet(new DiagramSet( new Name(), new Documentation(), new Id(), new Package(), new ProcessType(), new Version(), new AdHoc(false), new ProcessInstanceDescription(), new Imports(importsValue), new Executable(true), new SLADueDate() )); GraphNodeStoreImpl nodeStore = new GraphNodeStoreImpl(); NodeImpl x = new NodeImpl("x"); x.setContent(new ViewImpl<>(diag, Bounds.create())); nodeStore.add(x); ConverterFactory f = new ConverterFactory(new DefinitionsBuildingContext(new GraphImpl("x", nodeStore)), new PropertyWriterFactory()); DefinitionsConverter definitionsConverter = new DefinitionsConverter(f, new PropertyWriterFactory()); Definitions definitions = definitionsConverter.toDefinitions(); assertImportsValue(LOCATION, NAMESPACE, definitions); }