@Test public void testNullFindConsumerByServiceNameAndGadgetUrl() { OAuthConsumer consumer = sut.execute(new OAuthConsumerRequest("providerX", "http: assertTrue("Consumer found for serviceName of 'providerX' and gadget url of /some/path/gadgetX.xml", consumer == null); }
@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);  }