### Question:
ConditionEditorFieldEditorPresenter extends FieldEditorPresenter<ScriptTypeValue> { @PostConstruct public void init() { view.init(this); scriptEditor.setMode(ScriptTypeMode.FLOW_CONDITION); scriptEditor.addChangeHandler(this::onScriptChange); simpleConditionEditor.addChangeHandler(this::onSimpleConditionChange); if (!isServiceAvailable()) { showSimpleConditionEditor(); } else { showScriptEditor(); } } @Inject  ConditionEditorFieldEditorPresenter(final View view,
                                               final SimpleConditionEditorPresenter simpleConditionEditor,
                                               final ScriptTypeFieldEditorPresenter scriptEditor,
                                               final ErrorPopupPresenter errorPopup,
                                               final ConditionEditorParsingService conditionEditorParsingService,
                                               final ConditionEditorGeneratorService conditionEditorGeneratorService,
                                               final ClientTranslationService translationService); boolean isServiceAvailable(); @PostConstruct void init(); void init(ClientSession session); @Override void setReadOnly(boolean readOnly); @Override void setValue(ScriptTypeValue value);  }### Answer:
@Test public void testInit() { presenter.init(); verify(view).init(presenter); verify(scriptEditor).setMode(ScriptTypeMode.FLOW_CONDITION); verify(scriptEditor).addChangeHandler(any()); verify(simpleConditionEditor).addChangeHandler(any()); verifyShowSimpleConditionEditor(); assertEquals(view, presenter.getView()); }
@Test public void testInitSession() { presenter.init(session); verify(simpleConditionEditor).init(session); }
@Test public void testOnSingleSelection() { when(conditionEditorGeneratorService.isAvailable()).thenReturn(true); presenter = spy(new ConditionEditorFieldEditorPresenter(view, simpleConditionEditor, scriptEditor, errorPopup, conditionEditorParsingService, conditionEditorGeneratorService, translationService)); presenter.init(); verify(view, times(1)).setSingleOptionSelection(); }
@Test public void testNotOnSingleSelection() { when(conditionEditorGeneratorService.isAvailable()).thenReturn(false); presenter = spy(new ConditionEditorFieldEditorPresenter(view, simpleConditionEditor, scriptEditor, errorPopup, conditionEditorParsingService, conditionEditorGeneratorService, translationService)); presenter.init(); verify(view, never()).setSingleOptionSelection(); }