EnvHelper { public static boolean isSecure(final ActionParameters params) { return params.getHttpParam(PARAM_SECURE, params.getRequest().isSecure()); }  static void setupViews(List<View> views); static JSONObject getEnvironmentJSON(ActionParameters params, View view); static String getAPIurl(final ActionParameters params); static boolean isSecure(final ActionParameters params); static String getLoginUrl(); static String getLoginUrl(String lang); static boolean isRegistrationAllowed(); static String getRegisterUrl(); static String getRegisterUrl(String lang); static String getProfileUrl(); static String getProfileUrl(String lang); static String getLogoutUrl(); static String getLogoutUrl(String lang);  }
@Test public void testIsSecure() { assertFalse("isSecure should be false with default params", EnvHelper.isSecure(createActionParams())); Map<String, String> parameters = new HashMap<String, String>(); parameters.put(ActionConstants.PARAM_SECURE, "true"); assertTrue("isSecure should be true for request with param '" + ActionConstants.PARAM_SECURE + "' with value 'true'", EnvHelper.isSecure(createActionParams(parameters))); parameters.clear(); parameters.put(ActionConstants.PARAM_SECURE, "True"); assertTrue("isSecure should be true for request with param '" + ActionConstants.PARAM_SECURE + "' with value 'True'", EnvHelper.isSecure(createActionParams(parameters))); parameters.clear(); parameters.put(ActionConstants.PARAM_SECURE, "TRUE"); assertTrue("isSecure should be true for request with param '" + ActionConstants.PARAM_SECURE + "' with value 'TRUE'", EnvHelper.isSecure(createActionParams(parameters))); parameters.clear(); parameters.put(ActionConstants.PARAM_SECURE, "false"); assertFalse("isSecure should be false for request with param '" + ActionConstants.PARAM_SECURE + "' with value 'false'", EnvHelper.isSecure(createActionParams(parameters))); parameters.clear(); parameters.put(ActionConstants.PARAM_SECURE, "1"); assertFalse("isSecure should be false for request with param '" + ActionConstants.PARAM_SECURE + "' with value '1'", EnvHelper.isSecure(createActionParams(parameters))); parameters.clear(); parameters.put(ActionConstants.PARAM_SECURE, "yes"); assertFalse("isSecure should be false for request with param '" + ActionConstants.PARAM_SECURE + "' with value 'yes'", EnvHelper.isSecure(createActionParams(parameters))); }