HttpRequestUtils { public static boolean validateIntegerParam(final Map<String, String> params, final String paramName) throws ExecutorManagerException { if (params != null && params.containsKey(paramName) && !StringUtils.isNumeric(params.get(paramName))) { throw new ExecutorManagerException(paramName + " should be an integer"); } return true; }  static ExecutionOptions parseFlowOptions(final HttpServletRequest req,
      final String flowName); static void filterAdminOnlyFlowParams(final UserManager userManager,
      final ExecutionOptions options, final User user); static boolean validateIntegerParam(final Map<String, String> params,
      final String paramName); static boolean hasPermission(final UserManager userManager, final User user,
      final Permission.Type type); static boolean hasParam(final HttpServletRequest request, final String param); static String getParam(final HttpServletRequest request, final String name); static String getParam(final HttpServletRequest request, final String name,
      final String defaultVal); static int getIntParam(final HttpServletRequest request, final String name); static int getIntParam(final HttpServletRequest request, final String name,
      final int defaultVal); static boolean getBooleanParam(final HttpServletRequest request, final String name); static boolean getBooleanParam(final HttpServletRequest request,
      final String name, final boolean defaultVal); static long getLongParam(final HttpServletRequest request, final String name); static long getLongParam(final HttpServletRequest request, final String name,
      final long defaultVal); static Map<String, String> getParamGroup(final HttpServletRequest request,
      final String groupName); static Object getJsonBody(final HttpServletRequest request); static String getBody(final HttpServletRequest request); static final String PARAM_SLA_EMAILS; static final String PARAM_SLA_SETTINGS; }
@Test public void testvalidIntegerParam() throws ExecutorManagerException { final Map<String, String> params = new HashMap<>(); params.put("param1", "123"); HttpRequestUtils.validateIntegerParam(params, "param1"); }
@Test(expected = ExecutorManagerException.class) public void testInvalidIntegerParam() throws ExecutorManagerException { final Map<String, String> params = new HashMap<>(); params.put("param1", "1dff2"); HttpRequestUtils.validateIntegerParam(params, "param1"); }