KeycloakTokenValidator { public void validate(final String keycloakToken) throws KeycloakException { if (!isValid(keycloakToken)) { throw new KeycloakException("Keycloak token must have '" + BEARER_PREFIX + "' prefix"); } }  void validate(final String keycloakToken);  }
@Test public void processValidToken() throws KeycloakException { keycloakTokenValidator.validate(VALID_TOKEN); }
@Test(expected = KeycloakException.class) public void processInvalidToken() throws KeycloakException { keycloakTokenValidator.validate(INVALID_TOKEN); }