WW-4722 Renames constant for better readability

This commit is contained in:
Lukasz Lenart
2016-12-01 16:16:49 +01:00
parent a1b89842c0
commit bcea4c9baf
2 changed files with 4 additions and 5 deletions
@@ -35,7 +35,6 @@ import org.apache.struts2.dispatcher.Parameter;
import javax.servlet.http.Cookie;
import javax.servlet.http.HttpServletResponse;
import java.util.Arrays;
import java.util.Locale;
import java.util.Map;
@@ -96,12 +95,12 @@ public class I18nInterceptor extends AbstractInterceptor {
public static final String DEFAULT_SESSION_ATTRIBUTE = "WW_TRANS_I18N_LOCALE";
public static final String DEFAULT_PARAMETER = "request_locale";
public static final String DEFAULT_REQUESTONLY_PARAMETER = "request_only_locale";
public static final String DEFAULT_REQUEST_ONLY_PARAMETER = "request_only_locale";
public static final String DEFAULT_COOKIE_ATTRIBUTE = DEFAULT_SESSION_ATTRIBUTE;
public static final String DEFAULT_COOKIE_PARAMETER = "request_cookie_locale";
protected String parameterName = DEFAULT_PARAMETER;
protected String requestOnlyParameterName = DEFAULT_REQUESTONLY_PARAMETER;
protected String requestOnlyParameterName = DEFAULT_REQUEST_ONLY_PARAMETER;
protected String attributeName = DEFAULT_SESSION_ATTRIBUTE;
protected LocaleProvider localeProvider;
@@ -78,7 +78,7 @@ public class I18nInterceptorTest extends TestCase {
}
public void testDenmarkLocaleRequestOnly() throws Exception {
prepare(I18nInterceptor.DEFAULT_REQUESTONLY_PARAMETER, "da_DK");
prepare(I18nInterceptor.DEFAULT_REQUEST_ONLY_PARAMETER, "da_DK");
interceptor.intercept(mai);
assertFalse(mai.getInvocationContext().getParameters().get(I18nInterceptor.DEFAULT_PARAMETER).isDefined()); // should have been removed
@@ -124,7 +124,7 @@ public class I18nInterceptorTest extends TestCase {
}
public void testWithVariantRequestOnly() throws Exception {
prepare(I18nInterceptor.DEFAULT_REQUESTONLY_PARAMETER, "ja_JP_JP");
prepare(I18nInterceptor.DEFAULT_REQUEST_ONLY_PARAMETER, "ja_JP_JP");
interceptor.intercept(mai);
assertFalse(mai.getInvocationContext().getParameters().get(I18nInterceptor.DEFAULT_PARAMETER).isDefined()); // should have been removed