/** * Facebook can generate a HATEOAS link. * * @throws Exception If there is some problem inside */ @Test public void generatesLink() throws Exception { final Resource resource = new ResourceMocker().mock(); final Provider.Visible provider = new Facebook(resource, "KEY", "SECRET"); MatcherAssert.assertThat( provider.link().getHref().toString(), Matchers.allOf( Matchers.containsString("client_id=KEY"), Matchers.containsString("rexsl-facebook"))); }
/** * Google can generate a HATEOAS link. * * @throws Exception If there is some problem inside */ @Test public void generatesLink() throws Exception { final Resource resource = new ResourceMocker() .withUriInfo(new UriInfoMocker().withBaseUri(new URI("/A")).mock()) .mock(); final Provider.Visible provider = new Google(resource, "KEY", "SECRET"); MatcherAssert.assertThat( provider.link().getHref().toString(), Matchers.allOf( Matchers.containsString("client_id=KEY"), Matchers.containsString("state=rexsl-google"), Matchers.containsString("redirect_uri=/A"))); }