diff --git a/flow-lit-template/src/test/java/com/vaadin/flow/server/MockVaadinServletService.java b/flow-lit-template/src/test/java/com/vaadin/flow/server/MockVaadinServletService.java index 9dbcf79f95f..c9784292f26 100644 --- a/flow-lit-template/src/test/java/com/vaadin/flow/server/MockVaadinServletService.java +++ b/flow-lit-template/src/test/java/com/vaadin/flow/server/MockVaadinServletService.java @@ -95,6 +95,8 @@ protected List createRequestHandlers() public void init(Instantiator instantiator) { this.instantiator = instantiator; + + init(); } @Override @@ -118,7 +120,9 @@ public void init() { .thenReturn(resourceProvider); Mockito.when(context.getAttribute(Lookup.class.getName())) .thenReturn(lookup); - getServlet().init(config); + if (getServlet().getServletConfig() == null) { + getServlet().init(config); + } super.init(); } catch (ServiceException | ServletException e) { throw new RuntimeException(e); diff --git a/flow-polymer-template/src/test/java/com/vaadin/flow/server/MockVaadinServletService.java b/flow-polymer-template/src/test/java/com/vaadin/flow/server/MockVaadinServletService.java index 9dbcf79f95f..c9784292f26 100644 --- a/flow-polymer-template/src/test/java/com/vaadin/flow/server/MockVaadinServletService.java +++ b/flow-polymer-template/src/test/java/com/vaadin/flow/server/MockVaadinServletService.java @@ -95,6 +95,8 @@ protected List createRequestHandlers() public void init(Instantiator instantiator) { this.instantiator = instantiator; + + init(); } @Override @@ -118,7 +120,9 @@ public void init() { .thenReturn(resourceProvider); Mockito.when(context.getAttribute(Lookup.class.getName())) .thenReturn(lookup); - getServlet().init(config); + if (getServlet().getServletConfig() == null) { + getServlet().init(config); + } super.init(); } catch (ServiceException | ServletException e) { throw new RuntimeException(e);