|
|
@@ -22,7 +22,7 @@ class ReplaceChildrenControllerTest {
|
|
|
|
|
|
@Mock Container parent;
|
|
|
Function<Void, Collection<Void>> getChildren = (v) -> Arrays.asList(null, null);
|
|
|
- Function<Void, Component> makeView = (v) -> null;
|
|
|
+ Function<Void, Component> makeView = (v) -> mock(Component.class);
|
|
|
ReplaceChildrenController<Void, Void> controller;
|
|
|
|
|
|
@BeforeEach
|
|
|
@@ -32,7 +32,7 @@ class ReplaceChildrenControllerTest {
|
|
|
|
|
|
@Test
|
|
|
void testDoesNotReplaceComponentsWhenNoSizeChange() {
|
|
|
- doReturn(new Component[2]).when(parent).getComponents();
|
|
|
+ doReturn(new Component[] { mock(Component.class), mock(Component.class) }).when(parent).getComponents();
|
|
|
|
|
|
controller.accept(parent, null);
|
|
|
|
|
|
@@ -42,7 +42,7 @@ class ReplaceChildrenControllerTest {
|
|
|
|
|
|
@Test
|
|
|
void testReplacesComponents() {
|
|
|
- doReturn(new Component[1]).when(parent).getComponents();
|
|
|
+ doReturn(new Component[] { mock(Component.class) }).when(parent).getComponents();
|
|
|
|
|
|
controller.accept(parent, null);
|
|
|
|