[MGNLUI-5893] Fix intermittently failing tests for converted RichTextField Created: 22/May/20 Updated: 22/May/20 |
|
| Status: | Open |
| Project: | Magnolia UI |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Neutral |
| Reporter: | Adam Siska | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Template: |
|
| Acceptance criteria: |
Empty
|
| Task DoR: |
Empty
|
| Description |
|
info.magnolia.ui.dialog.FieldsConversionTest#testConvertedRichTextField Both tests could fail in two similar situation which are reproducible:
Both tests fail on NPE because VaadinService call in (RichTextFieldFactory.java:127) that should be set by:
VaadinRequest vaadinRequest = mock(VaadinRequest.class);
doReturn("path").when(vaadinRequest).getContextPath();
VaadinResponse vaadinResponse = mock(VaadinResponse.class);
VaadinService.getCurrent().setCurrentInstances(vaadinRequest, vaadinResponse);
in CompatibilityLayerJcrFormEnvironment::setUp, but under specified conditions VaadinService.getCurrentRequest() returns null here. Tests could be probably fixed (at least fails not reproducible by provided steps for maven anymore) by setting #setCurrentInstances() inside the test method instead of super.setUp(). Note that this VaadinRequest setup is only needed in case of RichTextField. |