void () { final String className = "Child"; final PyClass aClass = getClassByName(className); final List<PyMemberInfo<PyElement>> classMemberInfos = new PyMemberInfoStorage(aClass).getClassMemberInfos(aClass); assert !classMemberInfos.isEmpty() : "No member infos for " + className; final PyMemberInfo<PyElement> pyMemberInfo = classMemberInfos.get(0); EasyMock.expect(myView.getSelectedMemberInfos()).andReturn(Collections.singletonList(pyMemberInfo)).anyTimes(); EasyMock.expect(myView.getSuperClassName()).andReturn("INVALID CLASS NAME").anyTimes(); final Capture<String> errorMessageCapture = configureViewToCaptureError(); final PyExtractSuperclassPresenterImpl sut = configureByClass(className); myMocksControl.replay(); sut.launch(); sut.okClicked(); Assert.assertTrue("No error displayed for invalid class name", errorMessageCapture.hasCaptured()); }