HibernateIntegrationDefinitionDao extends HibernateDaoSupport implements IntegrationDefinitionDao { @SuppressWarnings("unchecked") public List<IntegrationDefinition> getIntegrationDefinitionOfProvider(String providerOrganizationId, String providerSystemId) { LOGGER.debug("get IntegrationDefinition of Provider(organizationId = \"{}\", systemId = \"{}\")", providerOrganizationId, providerSystemId); List<IntegrationDefinition> list = (List<IntegrationDefinition>)getHibernateTemplate().find( "from IntegrationDefinition as integrationDefinition " + "where integrationDefinition.provider.system.organization.id = ? " + "and integrationDefinition.provider.system.id = ?", new Object[] { providerOrganizationId, providerSystemId }); if (LOGGER.isDebugEnabled()) { LOGGER.debug("get IntegrationDefinition of Provider(organizationId = \"{}\", systemId = \"{}\")'s size = {}", providerOrganizationId, providerSystemId, list.size()); int i = 0; for (IntegrationDefinition integrationDefinition : list) { LOGGER.debug("[{}] : {}", i, integrationDefinition); i++; } } return list; }  IntegrationDefinition getIntegrationDefinition(String id); @SuppressWarnings("unchecked") List<IntegrationDefinition> getIntegrationDefinitionOfConsumer(String consumerOrganizationId, String consumerSystemId); @SuppressWarnings("unchecked") List<IntegrationDefinition> getIntegrationDefinitionOfProvider(String providerOrganizationId, String providerSystemId);  }
@Test public void testReadOfProviderSucceeds() throws Exception { List<IntegrationDefinition> list = dao.getIntegrationDefinitionOfProvider("00000000", "00000000"); assertEquals(1, list.size()); assertEquals("1", list.get(0).getId()); assertTrue(list.get(0).isValid()); }