use of com.vaadin.flow.component.ComponentTest.TracksAttachDetach in project flow by vaadin.
the class CompositeTest method setup.
@Before
public void setup() {
compositeWithComponent = new CompositeWithComponent() {
@Override
public String toString() {
return "Composite";
}
};
layoutWithSingleComponentComposite = new TestLayout() {
@Override
public String toString() {
return "Layout";
}
};
layoutWithSingleComponentComposite.addComponent(compositeWithComponent);
((TracksAttachDetach) componentInsideLayoutInsideComposite).track();
compositeWithComponent.track();
layoutInsideComposite.track();
layoutWithSingleComponentComposite.track();
Assert.assertNull(VaadinService.getCurrent());
VaadinService service = Mockito.mock(VaadinService.class);
DeploymentConfiguration configuration = Mockito.mock(DeploymentConfiguration.class);
Mockito.when(configuration.isProductionMode()).thenReturn(true);
Mockito.when(service.getDeploymentConfiguration()).thenReturn(configuration);
VaadinService.setCurrent(service);
}
Aggregations