DummyAuthenticator implements TokenAuthenticator { @Override public boolean authorize(String token) { return true; } DummyAuthenticator(); @Override boolean authorize(String token); @Override boolean authRequired();  }
@Test public void testAnyTokenWorks() { TokenAuthenticator authenticator = new DummyAuthenticator(); assertTrue(authenticator.authorize(null)); assertTrue(authenticator.authorize("")); assertTrue(authenticator.authorize("123456")); assertTrue(authenticator.authorize(RandomStringUtils.randomAlphanumeric(36))); }