Skip to content

Commit c3814fd

Browse files
cdbmbrianchandotcom
authored andcommitted
LPD-55269 fix new added captcha integration tests related to database.partition.enabled
1 parent 473774b commit c3814fd

File tree

1 file changed

+11
-1
lines changed
  • modules/apps/captcha/captcha-test/src/testIntegration/java/com/liferay/captcha/test/util

1 file changed

+11
-1
lines changed

modules/apps/captcha/captcha-test/src/testIntegration/java/com/liferay/captcha/test/util/CaptchaTestUtil.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,10 @@
55

66
package com.liferay.captcha.test.util;
77

8+
import com.liferay.portal.kernel.model.Company;
89
import com.liferay.portal.kernel.portlet.PortletURLFactoryUtil;
910
import com.liferay.portal.kernel.portlet.url.builder.PortletURLBuilder;
11+
import com.liferay.portal.kernel.service.CompanyLocalServiceUtil;
1012
import com.liferay.portal.kernel.service.LayoutLocalServiceUtil;
1113
import com.liferay.portal.kernel.test.util.TestPropsValues;
1214
import com.liferay.portal.kernel.theme.ThemeDisplay;
@@ -84,13 +86,21 @@ private static MockHttpServletRequest _getMockHttpServletRequest()
8486
themeDisplay.setLayout(
8587
LayoutLocalServiceUtil.fetchLayout(TestPropsValues.getPlid()));
8688
themeDisplay.setPlid(TestPropsValues.getPlid());
87-
themeDisplay.setPortalURL("http://localhost:8080");
89+
90+
Company company = CompanyLocalServiceUtil.getCompany(
91+
TestPropsValues.getCompanyId());
92+
93+
themeDisplay.setPortalURL(
94+
"http://" + company.getVirtualHostname() + ":8080");
95+
8896
themeDisplay.setScopeGroupId(TestPropsValues.getGroupId());
8997
themeDisplay.setSiteGroupId(TestPropsValues.getGroupId());
9098

9199
mockHttpServletRequest.setAttribute(
92100
WebKeys.THEME_DISPLAY, themeDisplay);
93101

102+
mockHttpServletRequest.setServerName(company.getVirtualHostname());
103+
94104
return mockHttpServletRequest;
95105
}
96106

0 commit comments

Comments
 (0)