Skip to content

Commit 74858ef

Browse files
author
Pekka Hyvönen
authored
chore: fix classloader for tests (#857)
1 parent 6d1444a commit 74858ef

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

vaadin-spring/src/test/java/com/vaadin/flow/spring/instantiator/SpringInstantiatorTest.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import javax.servlet.ServletConfig;
1919
import javax.servlet.ServletContext;
2020
import javax.servlet.ServletException;
21-
2221
import java.util.Collections;
2322
import java.util.List;
2423
import java.util.Locale;
@@ -48,8 +47,8 @@
4847
import com.vaadin.flow.function.DeploymentConfiguration;
4948
import com.vaadin.flow.i18n.I18NProvider;
5049
import com.vaadin.flow.server.ServiceInitEvent;
51-
import com.vaadin.flow.server.StaticFileServer;
5250
import com.vaadin.flow.server.StaticFileHandlerFactory;
51+
import com.vaadin.flow.server.StaticFileServer;
5352
import com.vaadin.flow.server.VaadinService;
5453
import com.vaadin.flow.server.VaadinServiceInitListener;
5554
import com.vaadin.flow.server.VaadinServletService;
@@ -186,6 +185,9 @@ protected DeploymentConfiguration createDeploymentConfiguration(
186185
ServletConfig config = Mockito.mock(ServletConfig.class);
187186
ServletContext servletContext = Mockito.mock(ServletContext.class);
188187

188+
Mockito.when(servletContext.getClassLoader())
189+
.thenReturn(servlet.getClass().getClassLoader());
190+
189191
ApplicationConfiguration appConfig = Mockito
190192
.mock(ApplicationConfiguration.class);
191193
Mockito.when(appConfig.getPropertyNames())

0 commit comments

Comments
 (0)