@Test public void testFindNullConsumer() { OAuthConsumer consumer = sut.execute("keyX"); assertTrue("Consumer found for token of 'keyX'", consumer == null); }
@Override @SuppressWarnings("unchecked") public OAuthConsumer execute(final String inRequest) { Query q = getEntityManager().createQuery("from OAuthConsumer c where c.consumerKey = :key").setParameter("key", inRequest); List results = q.getResultList(); return (results.size() == 0) ? null : (OAuthConsumer) results.get(0); }
GetOAuthConsumerByConsumerKey extends ReadMapper<String, OAuthConsumer> { @Override @SuppressWarnings("unchecked") public OAuthConsumer execute(final String inRequest) { Query q = getEntityManager().createQuery("from OAuthConsumer c where c.consumerKey = :key").setParameter("key", inRequest); List results = q.getResultList(); return (results.size() == 0) ? null : (OAuthConsumer) results.get(0); } }
GetOAuthConsumerByConsumerKey extends ReadMapper<String, OAuthConsumer> { @Override @SuppressWarnings("unchecked") public OAuthConsumer execute(final String inRequest) { Query q = getEntityManager().createQuery("from OAuthConsumer c where c.consumerKey = :key").setParameter("key", inRequest); List results = q.getResultList(); return (results.size() == 0) ? null : (OAuthConsumer) results.get(0); }  }
GetOAuthConsumerByConsumerKey extends ReadMapper<String, OAuthConsumer> { @Override @SuppressWarnings("unchecked") public OAuthConsumer execute(final String inRequest) { Query q = getEntityManager().createQuery("from OAuthConsumer c where c.consumerKey = :key").setParameter("key", inRequest); List results = q.getResultList(); return (results.size() == 0) ? null : (OAuthConsumer) results.get(0); }  @Override @SuppressWarnings("unchecked") OAuthConsumer execute(final String inRequest); }
GetOAuthConsumerByConsumerKey extends ReadMapper<String, OAuthConsumer> { @Override @SuppressWarnings("unchecked") public OAuthConsumer execute(final String inRequest) { Query q = getEntityManager().createQuery("from OAuthConsumer c where c.consumerKey = :key").setParameter("key", inRequest); List results = q.getResultList(); return (results.size() == 0) ? null : (OAuthConsumer) results.get(0); }  @Override @SuppressWarnings("unchecked") OAuthConsumer execute(final String inRequest);  }