EnvironmentCurator extends AbstractHibernateCurator<Environment> { @SuppressWarnings("unchecked") public CandlepinQuery<Environment> listForOwner(Owner o) { DetachedCriteria criteria = this.createSecureDetachedCriteria() .add(Restrictions.eq("owner", o)); return this.cpQueryFactory.<Environment>buildQuery(this.currentSession(), criteria); } EnvironmentCurator(); Environment getConsumerEnvironment(Consumer consumer); CandlepinQuery<Consumer> getEnvironmentConsumers(Environment environment); CandlepinQuery<Consumer> getEnvironmentConsumers(String environmentId); @SuppressWarnings("unchecked") CandlepinQuery<Environment> listForOwner(Owner o); @SuppressWarnings("unchecked") CandlepinQuery<Environment> listForOwnerByName(Owner o, String envName); @SuppressWarnings("unchecked") List<Environment> listWithContent(Set<String> contentIds); int deleteEnvironmentsForOwner(Owner owner); String getEnvironmentIdByName(String ownerId, String envName);  }
@Test public void listForOwner() { List<Environment> envs = envCurator.listForOwner(owner).list(); assertEquals(1, envs.size()); assertEquals(envs.get(0), environment); }