### Question:
AbstractCanvasInlineTextEditorControl extends AbstractCanvasHandlerRegistrationControl<AbstractCanvasHandler> implements CanvasInlineTextEditorControl<AbstractCanvasHandler, EditorSession, Element> { @Override public void register(final Element element) { if (checkNotRegistered(element)) { final Shape<?> shape = getShape(element.getUUID()); if (null != shape) { final ShapeView shapeView = shape.getShapeView(); if (shapeView instanceof HasEventHandlers) { final HasEventHandlers hasEventHandlers = (HasEventHandlers) shapeView; if (hasEventHandlers.supports(ViewEventType.TEXT_DBL_CLICK)) { registerTextDoubleClick(shape, element, hasEventHandlers); } if (hasEventHandlers.supports(ViewEventType.TEXT_ENTER)) { changeMouseCursorOnTextEnter(shape, hasEventHandlers); } if (hasEventHandlers.supports(ViewEventType.TEXT_EXIT)) { changeMouseCursorOnTextExit(shape, hasEventHandlers); } } } } }  @Override void bind(final EditorSession session); @Override void register(final Element element); @Override CanvasInlineTextEditorControl<AbstractCanvasHandler, EditorSession, Element> show(final Element item); @Override void setCommandManagerProvider(final CommandManagerProvider<AbstractCanvasHandler> provider); @Override CanvasInlineTextEditorControl<AbstractCanvasHandler, EditorSession, Element> rollback(); @Override CanvasInlineTextEditorControl<AbstractCanvasHandler, EditorSession, Element> hide(); void scheduleDeferredCommand(final Scheduler.ScheduledCommand command); static final double SHAPE_EDIT_ALPHA; static final double TITLE_EDIT_ALPHA; static final double NOT_EDIT_ALPHA; static final String ALIGN_MIDDLE; static final String ALIGN_LEFT; static final String ALIGN_TOP; static final String POSITION_INSIDE; static final String POSITION_OUTSIDE; static final String ORIENTATION_VERTICAL; static final String ORIENTATION_HORIZONTAL; static final double DEFAULT_MARGIN_X; static final double DEFAULT_FONT_SIZE; static final String DEFAULT_FONT_FAMILY; }### Answer:
@Test public void testRegisterTextEnter() { control.init(canvasHandler); when(testShapeView.supports(ViewEventType.TEXT_ENTER)).thenReturn(true); control.register(element); assertTrue(control.isRegistered(element)); verify(testShapeView).addHandler(eq(ViewEventType.TEXT_ENTER), textEnterHandlerCaptor.capture()); final TextEnterHandler textEnterHandler = textEnterHandlerCaptor.getValue(); textEnterHandler.handle(new TextEnterEvent(0, 1, SHAPE_X, SHAPE_Y)); verify(abstractCanvasView).setCursor(eq(AbstractCanvas.Cursors.TEXT)); }
@Test public void testRegisterTextExit() { control.init(canvasHandler); when(testShapeView.supports(ViewEventType.TEXT_EXIT)).thenReturn(true); control.register(element); assertTrue(control.isRegistered(element)); verify(testShapeView).addHandler(eq(ViewEventType.TEXT_EXIT), textExitHandlerCaptor.capture()); final TextExitHandler textExitHandler = textExitHandlerCaptor.getValue(); textExitHandler.handle(new TextExitEvent(0, 1, SHAPE_X, SHAPE_Y)); verify(abstractCanvasView).setCursor(eq(AbstractCanvas.Cursors.DEFAULT)); }