### Question:
DRGElementTextPropertyProviderImpl implements TextPropertyProvider { @Override public void setText(final AbstractCanvasHandler canvasHandler, final CanvasCommandManager<AbstractCanvasHandler> commandManager, final Element<? extends Definition> element, final String text) { final Object definition = DefinitionUtils.getElementDefinition(element); final CanvasCommand<AbstractCanvasHandler> command = canvasCommandFactory.updatePropertyValue(element, definitionUtils.getNameIdentifier(definition), new Name(NameUtils.normaliseName(text))); commandManager.execute(canvasHandler, command); } DRGElementTextPropertyProviderImpl(); @Inject  DRGElementTextPropertyProviderImpl(final @DMNEditor DefaultCanvasCommandFactory canvasCommandFactory,
                                              final DefinitionUtils definitionUtils); @Override int getPriority(); @Override boolean supports(final Element<? extends Definition> element); @Override String getText(final Element<? extends Definition> element); @Override void setText(final AbstractCanvasHandler canvasHandler,
                        final CanvasCommandManager<AbstractCanvasHandler> commandManager,
                        final Element<? extends Definition> element,
                        final String text);  }### Answer:
@Test public void checkWriteUsesCommandToUpdateTextProperty() { provider.setText(canvasHandler, commandManager, element, NAME_VALUE); verify(canvasCommandFactory).updatePropertyValue(eq(element), eq(NAME_FIELD), nameArgumentCaptor.capture()); assertEquals(NAME_VALUE, nameArgumentCaptor.getValue().getValue()); verify(commandManager).execute(eq(canvasHandler), eq(command)); }
@Test public void checkWriteUsesCommandToUpdateTextPropertyWithWhitespace() { provider.setText(canvasHandler, commandManager, element, NAME_VALUE_WITH_WHITESPACE); verify(canvasCommandFactory).updatePropertyValue(eq(element), eq(NAME_FIELD), nameArgumentCaptor.capture()); assertEquals(NAME_VALUE, nameArgumentCaptor.getValue().getValue()); verify(commandManager).execute(eq(canvasHandler), eq(command)); }