Mock beans in unit tests [message #1835829] |
Mon, 14 December 2020 13:44 |
Andreas Forster Messages: 4 Registered: December 2020 |
Junior Member |
|
|
Hi all,
I've started on a scout 10.0 project and am wondering how to mock Beans in a unit test, specifically AccessSupport in the server context.
The following code leads to the exception "org.eclipse.scout.rt.platform.exception.PlatformException: The platform is in an invalid state.":
@RunWith(ServerTestRunner.class)
public class ServiceTest {
@Before
public void init() {
BeanTestingHelper beanTestingHelper = new BeanTestingHelper();
AccessSupport accessSupport = mock(AccessSupport.class);
beanTestingHelper.registerBean(new BeanMetaData(AccessSupport.class, accessSupport));
Any ideas?
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03971 seconds