@Test public void emptyStringIsNotValidToken() { try { HttpUtils.checkToken(""); fail("Empty string is not a valid token"); } catch (IllegalArgumentException e) { assertThat(e.getCause().getMessage(),equalTo("Token cannot be empty")); } }
static void checkToken(final String token, final String message, Object... args) { checkNotNull(message,"Message cannot be null"); try { validateLength(token); validateCharacters(token); } catch (IllegalArgumentException e) { throw new InvalidTokenException(String.format(message,args),token,e); } }
HttpUtils { static void checkToken(final String token, final String message, Object... args) { checkNotNull(message,"Message cannot be null"); try { validateLength(token); validateCharacters(token); } catch (IllegalArgumentException e) { throw new InvalidTokenException(String.format(message,args),token,e); } } }
HttpUtils { static void checkToken(final String token, final String message, Object... args) { checkNotNull(message,"Message cannot be null"); try { validateLength(token); validateCharacters(token); } catch (IllegalArgumentException e) { throw new InvalidTokenException(String.format(message,args),token,e); } } private  HttpUtils(); }
HttpUtils { static void checkToken(final String token, final String message, Object... args) { checkNotNull(message,"Message cannot be null"); try { validateLength(token); validateCharacters(token); } catch (IllegalArgumentException e) { throw new InvalidTokenException(String.format(message,args),token,e); } } private  HttpUtils();  }
HttpUtils { static void checkToken(final String token, final String message, Object... args) { checkNotNull(message,"Message cannot be null"); try { validateLength(token); validateCharacters(token); } catch (IllegalArgumentException e) { throw new InvalidTokenException(String.format(message,args),token,e); } } private  HttpUtils();   }