### Question:
VaadinPortletService extends VaadinService { @Override public String getStaticFileLocation(VaadinRequest request) { String staticFileLocation = getParameter(request, Constants.PORTAL_PARAMETER_VAADIN_RESOURCE_PATH, "/html"); if (Constants.PORTLET_CONTEXT.equals(staticFileLocation)) { return request.getContextPath(); } else { return trimTrailingSlashes(staticFileLocation); } } VaadinPortletService(VaadinPortlet portlet,
            DeploymentConfiguration deploymentConfiguration); VaadinPortlet getPortlet(); @Override String getConfiguredWidgetset(VaadinRequest request); @Override String getConfiguredTheme(VaadinRequest request); @Override boolean isStandalone(VaadinRequest request); @Override String getStaticFileLocation(VaadinRequest request); @Override String getMimeType(String resourceName); @Override File getBaseDirectory(); static PortletRequest getCurrentPortletRequest(); static VaadinPortletRequest getCurrentRequest(); static VaadinPortletResponse getCurrentResponse(); @Override String getServiceName(); @Override boolean preserveUIOnRefresh(UIProvider provider, UICreateEvent event); @Override InputStream getThemeResourceAsStream(UI uI, String themeName,
            String resource); @Override String getMainDivId(VaadinSession session, VaadinRequest request,
            Class<? extends UI> uiClass);  }### Answer:
@Test public void preferencesOverrideDeploymentConfiguration() { mockFileLocationPreference("prefs"); mockLocationDeploymentConfiguration("conf"); String location = getStaticFileLocation(); assertThat(location, is("prefs")); }
@Test public void deploymentConfigurationOverridesProperties() { mockFileLocationPreference(null); mockLocationDeploymentConfiguration("conf"); mockFileLocationProperty("props"); String location = getStaticFileLocation(); assertThat(location, is("conf")); }
@Test public void defaultFileLocationIsSet() { mockFileLocationPreference(null); mockLocationDeploymentConfiguration(null); mockFileLocationProperty(null); String location = getStaticFileLocation(); assertThat(location, is("/html")); }
@Test public void trailingSlashesAreTrimmedFromStaticFileLocation() { mockFileLocationPreference("/content String staticFileLocation = getStaticFileLocation(); assertThat(staticFileLocation, is("/content")); }