@Test public void testFindConsumerByServiceNameAndGadgetUrl() { OAuthConsumer consumer = sut .execute(new OAuthConsumerRequest("provider1", "http: assertTrue( "No Consumer found for serviceName of 'provider1' and gadget url of http: consumer != null); assertEquals("Incorrect consumer key returned", "key1", consumer.getConsumerKey()); assertEquals("Incorrect consumer secret returned", "secret1", consumer.getConsumerSecret()); assertEquals("Incorrect signature method", "HMAC-SHA1", consumer.getSignatureMethod()); }
@Override @SuppressWarnings("unchecked") public OAuthConsumer execute(final OAuthConsumerRequest inRequest) { Query q = getEntityManager().createQuery( "from OAuthConsumer c where c.serviceProviderName = :serviceName and c.gadgetUrl = :gadgetUrl") .setParameter("serviceName", inRequest.getServiceProviderName()).setParameter("gadgetUrl", inRequest.getGadgetUrl()); List results = q.getResultList(); return (results.size() == 0) ? null : (OAuthConsumer) results.get(0); }
GetOAuthConsumerByServiceName extends ReadMapper<OAuthConsumerRequest, OAuthConsumer> { @Override @SuppressWarnings("unchecked") public OAuthConsumer execute(final OAuthConsumerRequest inRequest) { Query q = getEntityManager().createQuery( "from OAuthConsumer c where c.serviceProviderName = :serviceName and c.gadgetUrl = :gadgetUrl") .setParameter("serviceName", inRequest.getServiceProviderName()).setParameter("gadgetUrl", inRequest.getGadgetUrl()); List results = q.getResultList(); return (results.size() == 0) ? null : (OAuthConsumer) results.get(0); } }
GetOAuthConsumerByServiceName extends ReadMapper<OAuthConsumerRequest, OAuthConsumer> { @Override @SuppressWarnings("unchecked") public OAuthConsumer execute(final OAuthConsumerRequest inRequest) { Query q = getEntityManager().createQuery( "from OAuthConsumer c where c.serviceProviderName = :serviceName and c.gadgetUrl = :gadgetUrl") .setParameter("serviceName", inRequest.getServiceProviderName()).setParameter("gadgetUrl", inRequest.getGadgetUrl()); List results = q.getResultList(); return (results.size() == 0) ? null : (OAuthConsumer) results.get(0); }  }
GetOAuthConsumerByServiceName extends ReadMapper<OAuthConsumerRequest, OAuthConsumer> { @Override @SuppressWarnings("unchecked") public OAuthConsumer execute(final OAuthConsumerRequest inRequest) { Query q = getEntityManager().createQuery( "from OAuthConsumer c where c.serviceProviderName = :serviceName and c.gadgetUrl = :gadgetUrl") .setParameter("serviceName", inRequest.getServiceProviderName()).setParameter("gadgetUrl", inRequest.getGadgetUrl()); List results = q.getResultList(); return (results.size() == 0) ? null : (OAuthConsumer) results.get(0); }  @Override @SuppressWarnings("unchecked") OAuthConsumer execute(final OAuthConsumerRequest inRequest); }
GetOAuthConsumerByServiceName extends ReadMapper<OAuthConsumerRequest, OAuthConsumer> { @Override @SuppressWarnings("unchecked") public OAuthConsumer execute(final OAuthConsumerRequest inRequest) { Query q = getEntityManager().createQuery( "from OAuthConsumer c where c.serviceProviderName = :serviceName and c.gadgetUrl = :gadgetUrl") .setParameter("serviceName", inRequest.getServiceProviderName()).setParameter("gadgetUrl", inRequest.getGadgetUrl()); List results = q.getResultList(); return (results.size() == 0) ? null : (OAuthConsumer) results.get(0); }  @Override @SuppressWarnings("unchecked") OAuthConsumer execute(final OAuthConsumerRequest inRequest);  }