/** * assert that string matches the given pattern * * @param string the string to check * @param pattern the pattern to check * @throws WebApplicationException with status code 422 (Unprocessable Entity) */ public static void assertPattern(String string, String pattern) { RESTAssert.assertPattern(string, pattern, RESTAssert.DEFAULT_STATUS_CODE); }
/** * assert that string matches [+-]?[0-9]* * * @param string the string to check * @param status the status code to throw * @throws WebApplicationException with given status code */ public static void assertInt(final String string, final StatusType status) { RESTAssert.assertNotEmpty(string); RESTAssert.assertPattern(string, "[+-]?[0-9]*", status); }