public void testNoCode() throws RequiresHttpAction { try { getClient().getCredentials(MockWebContext.create()); fail("should not get credentials"); } catch (final TechnicalException e) { assertEquals("No credential found", e.getMessage()); } }
public void testMissingUser() throws RequiresHttpAction { final MyOpenIdClient client = (MyOpenIdClient) getClient(); try { client.getRedirectionUrl(MockWebContext.create(), true, false); fail("should fail because of missing OpenID user"); } catch (final TechnicalException e) { assertEquals("openIdUser cannot be blank", e.getMessage()); } }