|
17 | 17 | import com.liferay.portal.kernel.portlet.PortalPreferences; |
18 | 18 | import com.liferay.portal.kernel.portlet.PortletPreferencesFactory; |
19 | 19 | import com.liferay.portal.kernel.portlet.PortletPreferencesFactoryUtil; |
| 20 | +import com.liferay.portal.kernel.test.rule.NewEnv; |
| 21 | +import com.liferay.portal.kernel.test.util.PropsTestUtil; |
20 | 22 | import com.liferay.portal.kernel.test.util.RandomTestUtil; |
21 | 23 | import com.liferay.portal.test.rule.LiferayUnitTestRule; |
22 | | -import com.liferay.portal.test.rule.PortalProps; |
23 | 24 | import com.liferay.portlet.PortalPreferencesImpl; |
24 | 25 |
|
25 | 26 | import java.util.List; |
|
38 | 39 | /** |
39 | 40 | * @author Dante Wang |
40 | 41 | */ |
| 42 | +@NewEnv(type = NewEnv.Type.CLASSLOADER) |
41 | 43 | public class SessionClicksTest { |
42 | 44 |
|
43 | 45 | @ClassRule |
44 | 46 | @Rule |
45 | 47 | public static final LiferayUnitTestRule liferayUnitTestRule = |
46 | 48 | LiferayUnitTestRule.INSTANCE; |
47 | 49 |
|
48 | | - @PortalProps( |
49 | | - properties = PropsKeys.SESSION_CLICKS_MAX_ALLOWED_VALUES + "=" + _MAX_ALLOWED_VALUES |
50 | | - ) |
51 | 50 | @Test |
52 | 51 | public void testPutMaxAllowedValues() { |
| 52 | + PropsTestUtil.setProps( |
| 53 | + HashMapBuilder.<String, Object>put( |
| 54 | + PropsKeys.SESSION_CLICKS_MAX_ALLOWED_VALUES, |
| 55 | + String.valueOf(_MAX_ALLOWED_VALUES) |
| 56 | + ).put( |
| 57 | + PropsKeys.SESSION_CLICKS_MAX_SIZE_TERMS, |
| 58 | + String.valueOf(Integer.MAX_VALUE) |
| 59 | + ).build()); |
| 60 | + |
53 | 61 | PortalPreferences portalPreferences = new PortalPreferencesImpl(); |
54 | 62 |
|
55 | 63 | PortletPreferencesFactoryUtil portletPreferencesFactoryUtil = |
@@ -106,11 +114,17 @@ public void testPutMaxAllowedValues() { |
106 | 114 | attributeNames.size()); |
107 | 115 | } |
108 | 116 |
|
109 | | - @PortalProps( |
110 | | - properties = PropsKeys.SESSION_CLICKS_MAX_SIZE_TERMS + "=" + _MAX_SIZE_TERMS |
111 | | - ) |
112 | 117 | @Test |
113 | 118 | public void testPutMaxSizeTerms() { |
| 119 | + PropsTestUtil.setProps( |
| 120 | + HashMapBuilder.<String, Object>put( |
| 121 | + PropsKeys.SESSION_CLICKS_MAX_ALLOWED_VALUES, |
| 122 | + String.valueOf(Integer.MAX_VALUE) |
| 123 | + ).put( |
| 124 | + PropsKeys.SESSION_CLICKS_MAX_SIZE_TERMS, |
| 125 | + String.valueOf(_MAX_SIZE_TERMS) |
| 126 | + ).build()); |
| 127 | + |
114 | 128 | HttpSession httpSession = new MockHttpSession(); |
115 | 129 |
|
116 | 130 | String key = RandomTestUtil.randomString(_MAX_SIZE_TERMS - 1); |
|
0 commit comments