Search in sources :

Example 76 with VaadinService

use of com.vaadin.flow.server.VaadinService in project flow by vaadin.

the class FrontendUtilsTest method formattingError_assetsByChunkIsCorrectlyParsedFromStats.

@Test
public void formattingError_assetsByChunkIsCorrectlyParsedFromStats() throws IOException, ServiceException {
    VaadinService service = setupStatsAssetMocks("MissFormatStats.json");
    String statsAssetsByChunkName = FrontendUtils.getStatsAssetsByChunkName(service);
    Assert.assertEquals("{\"bundle\": \"build/vaadin-bundle-1111.cache.js\"}", statsAssetsByChunkName);
}
Also used : VaadinService(com.vaadin.flow.server.VaadinService) Test(org.junit.Test)

Example 77 with VaadinService

use of com.vaadin.flow.server.VaadinService in project flow by vaadin.

the class SpringServletTest method pushURL_rootMappingAndCustomURLWithContextVaadinServletPrefix_isNotAdditionallyPrefixed.

@Test
public void pushURL_rootMappingAndCustomURLWithContextVaadinServletPrefix_isNotAdditionallyPrefixed() throws ServletException {
    final Properties properties = new Properties();
    properties.setProperty("pushURL", "context://vaadinServlet/customUrl");
    VaadinService service = SpringInstantiatorTest.getService(context, properties, true);
    Assert.assertEquals("context://vaadinServlet/customUrl", service.getDeploymentConfiguration().getPushURL());
}
Also used : VaadinService(com.vaadin.flow.server.VaadinService) Properties(java.util.Properties) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) SpringInstantiatorTest(com.vaadin.flow.spring.instantiator.SpringInstantiatorTest)

Example 78 with VaadinService

use of com.vaadin.flow.server.VaadinService in project flow by vaadin.

the class SpringServletTest method pushURL_rootMappingAndCustomURLWithVaadinServletPrefix_isNotAdditionallyPrefixed.

@Test
public void pushURL_rootMappingAndCustomURLWithVaadinServletPrefix_isNotAdditionallyPrefixed() throws ServletException {
    final Properties properties = new Properties();
    properties.setProperty("pushURL", "/vaadinServlet/customUrl");
    VaadinService service = SpringInstantiatorTest.getService(context, properties, true);
    Assert.assertEquals("context://vaadinServlet/customUrl", service.getDeploymentConfiguration().getPushURL());
}
Also used : VaadinService(com.vaadin.flow.server.VaadinService) Properties(java.util.Properties) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) SpringInstantiatorTest(com.vaadin.flow.spring.instantiator.SpringInstantiatorTest)

Example 79 with VaadinService

use of com.vaadin.flow.server.VaadinService in project flow by vaadin.

the class SpringServletTest method pushURL_rootMappingAndCustomURLWithPrecedingSlash_isPrefixedWithContextVaadinMapping.

@Test
public void pushURL_rootMappingAndCustomURLWithPrecedingSlash_isPrefixedWithContextVaadinMapping() throws ServletException {
    final Properties configProperties = new Properties();
    configProperties.setProperty("pushURL", "/customUrl");
    VaadinService service = SpringInstantiatorTest.getService(context, configProperties, true);
    Assert.assertEquals("context://vaadinServlet/customUrl", service.getDeploymentConfiguration().getPushURL());
}
Also used : VaadinService(com.vaadin.flow.server.VaadinService) Properties(java.util.Properties) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) SpringInstantiatorTest(com.vaadin.flow.spring.instantiator.SpringInstantiatorTest)

Example 80 with VaadinService

use of com.vaadin.flow.server.VaadinService in project flow by vaadin.

the class SpringServletTest method pushURL_rootMapping_isPrefixedWithContextVaadinMapping.

@Test
public void pushURL_rootMapping_isPrefixedWithContextVaadinMapping() throws ServletException {
    VaadinService service = SpringInstantiatorTest.getService(context, new Properties(), true);
    Assert.assertEquals("context://vaadinServlet/", service.getDeploymentConfiguration().getPushURL());
}
Also used : VaadinService(com.vaadin.flow.server.VaadinService) Properties(java.util.Properties) Test(org.junit.Test) SpringBootTest(org.springframework.boot.test.context.SpringBootTest) SpringInstantiatorTest(com.vaadin.flow.spring.instantiator.SpringInstantiatorTest)

Aggregations

VaadinService (com.vaadin.flow.server.VaadinService)86 Test (org.junit.Test)39 DeploymentConfiguration (com.vaadin.flow.function.DeploymentConfiguration)19 VaadinSession (com.vaadin.flow.server.VaadinSession)18 Properties (java.util.Properties)15 VaadinContext (com.vaadin.flow.server.VaadinContext)12 Before (org.junit.Before)11 SpringInstantiatorTest (com.vaadin.flow.spring.instantiator.SpringInstantiatorTest)10 UI (com.vaadin.flow.component.UI)9 ApplicationConfiguration (com.vaadin.flow.server.startup.ApplicationConfiguration)8 Lookup (com.vaadin.flow.di.Lookup)7 VaadinResponse (com.vaadin.flow.server.VaadinResponse)7 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)7 ServletContext (javax.servlet.ServletContext)6 MockVaadinContext (com.vaadin.flow.server.MockVaadinContext)5 DefaultInstantiator (com.vaadin.flow.di.DefaultInstantiator)4 Instantiator (com.vaadin.flow.di.Instantiator)4 BrowserLiveReload (com.vaadin.flow.internal.BrowserLiveReload)4 DefaultDeploymentConfiguration (com.vaadin.flow.server.DefaultDeploymentConfiguration)4 MockVaadinServletService (com.vaadin.flow.server.MockVaadinServletService)4